1. Home
  2. /
  3. Uikit
  4. /
  5. Accordion Example

Accordion Example - Uikit Typing CST Test

Loading…

Accordion Example — Uikit Code

Demonstrates an accordion component using UIkit classes.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.16.21/dist/css/uikit.min.css">
	<title>UIkit Accordion</title>
</head>
<body class="uk-container uk-margin-top">
	<ul uk-accordion>
		<li class="uk-open">
		<a class="uk-accordion-title" href="#">Section 1</a>
		<div class="uk-accordion-content">
		<p>Content for section 1</p>
		</div>
		</li>
		<li>
		<a class="uk-accordion-title" href="#">Section 2</a>
		<div class="uk-accordion-content">
		<p>Content for section 2</p>
		</div>
		</li>
	</ul>

	<script src="https://cdn.jsdelivr.net/npm/uikit@3.16.21/dist/js/uikit.min.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/uikit@3.16.21/dist/js/uikit-icons.min.js"></script>
</body>
</html>

Uikit Language Guide

UIkit is a lightweight, modular front-end framework for developing fast and powerful web interfaces. It offers a responsive grid, prebuilt components, and JavaScript plugins to create interactive UI elements.

Primary Use Cases

  • ▸Responsive websites and web apps
  • ▸Landing pages and marketing sites
  • ▸Admin dashboards
  • ▸Rapid prototyping
  • ▸Projects needing modular JS components

Notable Features

  • ▸12-column responsive grid system
  • ▸Modular CSS and JS components
  • ▸Prebuilt UI elements (buttons, forms, modals, sliders)
  • ▸JavaScript plugins for interactivity
  • ▸Sass/Less support for theming and customization

Origin & Creator

Created by YOOtheme in 2013 as a modern, modular framework for web interfaces.

Industrial Note

UIkit is often used in web apps, marketing sites, and lightweight dashboards where a modular, customizable, and responsive framework is desired.

Quick Explain

  • ▸UIkit provides a comprehensive CSS and JS framework for building responsive websites.
  • ▸It includes a grid system, prebuilt components like buttons, modals, sliders, and forms.
  • ▸JavaScript plugins enable interactivity such as accordions, lightboxes, and sticky elements.

Core Features

  • ▸Responsive grid layout
  • ▸Typography, spacing, and color utilities
  • ▸Modular component system
  • ▸JavaScript-driven interactive components
  • ▸Lightweight and flexible for custom designs

Learning Path

  • ▸Learn responsive grid system (`uk-grid` and `uk-width-*`)
  • ▸Explore prebuilt components and JS plugins
  • ▸Practice utility classes and modifiers
  • ▸Build interactive components with JS plugins
  • ▸Customize themes using Sass or Less

Practical Examples

  • ▸Responsive navbar with dropdowns
  • ▸Card-based content layout
  • ▸Form with styled inputs and validation
  • ▸Lightbox gallery for images
  • ▸Accordion or tabbed content sections

Comparisons

  • ▸More modular than Bootstrap
  • ▸Lightweight alternative to Materialize or Bulma
  • ▸Includes JS components unlike Bulma
  • ▸Smaller community than Bootstrap
  • ▸Clean and consistent design patterns

Strengths

  • ▸Fully modular - import only what is needed
  • ▸Responsive and mobile-first
  • ▸Includes JS components for interactivity
  • ▸Lightweight and easy to customize
  • ▸Clean, consistent design patterns

Limitations

  • ▸Smaller ecosystem than Bootstrap
  • ▸Documentation can be less comprehensive
  • ▸Less widespread adoption for community support
  • ▸Some advanced components require custom JS
  • ▸Not Material Design based - style is framework-specific

When NOT to Use

  • ▸When large ecosystem and community support are needed
  • ▸If Material Design is required
  • ▸Projects requiring extensive third-party components
  • ▸Heavy JS-based applications where other frameworks dominate
  • ▸Non-modular design preference

Cheat Sheet

  • ▸`uk-container` - main layout wrapper
  • ▸`uk-grid` - grid row
  • ▸`uk-width-1-3@m` - column width for medium screens
  • ▸`uk-button` - prebuilt button
  • ▸`uk-modal`, `uk-slider` - interactive JS components

FAQ

  • ▸Is UIkit free?
  • ▸Yes - open-source under MIT license.
  • ▸Does UIkit include JS?
  • ▸Yes - for interactive components.
  • ▸Is UIkit responsive?
  • ▸Yes - mobile-first grid system.
  • ▸Can I customize UIkit?
  • ▸Yes - via Sass or Less variables and modular imports.
  • ▸Which browsers does UIkit support?
  • ▸All modern browsers with Flexbox support.

30-Day Skill Plan

  • ▸Week 1: Basic grid + container layout
  • ▸Week 2: Components (cards, buttons, forms)
  • ▸Week 3: Interactive JS plugins (modals, sliders, accordions)
  • ▸Week 4: Utility classes and responsive modifiers
  • ▸Week 5: Advanced theming and modular builds

Final Summary

  • ▸UIkit is a lightweight, modular front-end framework.
  • ▸Provides responsive grid, prebuilt components, and JS plugins.
  • ▸Mobile-first and highly customizable via Sass/Less.
  • ▸Ideal for dashboards, marketing sites, and modular SPAs.
  • ▸Focuses on clean, consistent UI patterns.

Project Structure

  • ▸index.html - main layout
  • ▸assets/css/ - custom styles or Sass overrides
  • ▸assets/js/ - optional custom scripts
  • ▸node_modules/uikit - installed framework
  • ▸partials/ - reusable components (navbar, footer)

Monetization

  • ▸Develop UIkit templates for sale
  • ▸Create dashboards and landing pages
  • ▸Rapid prototyping services
  • ▸Custom SPA development
  • ▸Web UI consulting

Productivity Tips

  • ▸Use prebuilt components over custom CSS
  • ▸Initialize JS plugins carefully
  • ▸Customize Sass/Less early
  • ▸Import only required modules
  • ▸Test responsive layouts frequently

Basic Concepts

  • ▸Containers (`uk-container`) and grid (`uk-grid`, `uk-width-*`) system
  • ▸Prebuilt components: buttons, cards, modals, sliders
  • ▸Modifiers for colors, sizes, and responsive behavior
  • ▸JavaScript plugins for dropdowns, accordions, lightboxes
  • ▸Utility classes for alignment, spacing, and typography

Official Docs

  • ▸https://getuikit.com/
  • ▸https://github.com/uikit/uikit
  • ▸https://getuikit.com/docs/introduction

More Uikit Typing Exercises

UIkit Counter ExampleUIkit Navbar ExampleUIkit Card ExampleUIkit Modal ExampleUIkit Tab ExampleUIkit Slideshow ExampleUIkit Tooltip ExampleUIkit Progress Bar Example

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher