Cirrus UI Documentation
website·Indexed 32 days ago
https://cirrus-ui.com/A utility-first CSS framework featuring a comprehensive set of layout tools, grid systems, and utility classes for display, positioning, and spacing. Includes a Plugin API for custom style injection and support for pseudo-variants as of version 0.8.0.
What's inside Cirrus UI
- Cirrus is a modular, responsive, and component-centric SCSS framework. It provides a set of pre-built components and utility classes to enable rapid prototyping and a consistent design system without requiring additional JavaScript libraries. The framework is fully open-source and can be used via a single minified CSS file from a CDN.
Overview of Cirrus UI Framework Architecture
Cirrus UI is organized into three primary types of stylesheets that work together to style a project:
- Base: Essential foundation styles including resets, fonts, colors, layout/positioning, grid, media, and spacing.
- Component: Prebuilt, high-level UI elements (e.g., Buttons, Forms, Headers) that can be added to projects immediately.
- Utilities: Atomic classes used to modify specific styles of individual elements.
Use Cirrus Blocks for pre-designed components and layouts
Cirrus Blocks is a collection of over 50 pre-designed components and layouts developed by the Cirrus team. These blocks are designed to be copied and pasted directly into projects and are available in HTML, React, and Vue formats.Visit https://cirrus-blocks.com to sign up and access the components.Choose between Cirrus Core and Extended builds
Cirrus provides two different build flavors depending on the required set of styles and components:
- Core: Contains essential styles including Base (Animations, Font, Grid, Layout, Media, Modifiers, Spacing), Core Components (Button, Code, Footer, Forms, Frames, Header, Links, Lists, Progress, Table), and Utilities (Absolute, Clearfix, Display, Flex, Misc, Opacity, Overflow, Position, Round, Shadows, Z-Index). The distribution file is
cirrus-core.min.css. - Ext (Full): Includes everything in Core plus Extended Components for rapid prototyping, such as Avatar, Breadcrumb, Card, Form Extended, Link Extended, Modal, Pagination, Placeholder, Tabs, Tags, Tiles, Toast, and Tooltips. The distribution file is
cirrus.min.css.
- Core: Contains essential styles including Base (Animations, Font, Grid, Layout, Media, Modifiers, Spacing), Core Components (Button, Code, Footer, Forms, Frames, Header, Links, Lists, Progress, Table), and Utilities (Absolute, Clearfix, Display, Flex, Misc, Opacity, Overflow, Position, Round, Shadows, Z-Index). The distribution file is
Understand Cirrus typography defaults and sizing
Cirrus uses a rem-based sizing system where the default is 1rem (16px). Because rems are independent of parent element font sizes, each 1rem interval equals 16 pixels. The framework utilizes two primary typefaces: Nunito Sans for body content and Montserrat for headings.Understand Cirrus UI default responsive behavior
Cirrus UI is designed for mobile-optimized sites. Component styles automatically resize based on page width, and several elements have built-in responsive behaviors:
h1and other text elements shrink on mobile to maintain proportion.header-navitems move into a dropdown menu on mobile.- Columns inside a
rowor elements inside alevelstack vertically on mobile by default (this can be overridden usingcol-[i]classes).
Make tables horizontally scrollable with Table Container
To prevent large tables with many columns from breaking the layout—especially on smaller devices—wrap the<table>element in a<div>with thetable-containerclass. This enables horizontal scrolling for the table content.<div class="table-container"> <table> <!-- table content --> </table> </div>Mark a table row as selected
To visually highlight a specific row as selected, add theselectedclass to the<tr>element of that row.<tr class="selected"> <th>3</th> <td>Row:3 Cell:1</td> <td>Row:3 Cell:2</td> </tr>Apply responsive grid layouts
Apply grid classes conditionally based on viewport size by prefixing the class with a viewport selector (e.g.,lg:).<!-- Only applies grid layout on large screens and above --> <div class="lg:grid"> <!-- ... --> </div>Open and close Modals using CSS and anchors
Modals can be controlled without JavaScript by using HTML anchor links and the browser's native ID-based navigation.
- Opening: Set the
hrefof a link to theidof the modal (e.g.,<a href="#test-modal">). - Closing: Use an anchor tag as a close button. The
hrefvalue determines the browser behavior after the modal closes:
<!-- Modal Definition --> <div class="modal" id="test-modal"> <div class="modal-header"> <!-- Close button examples --> <a href="#TAG-OUTSIDE">Return to Specific Div</a> <a href="#">Return to Top</a> <a href="#NON-EXISTENT-DIV">Keep Scroll Position</a> </div> </div> <!-- Trigger to open --> <a href="#test-modal">Open Modal</a>- Opening: Set the
Create stylized and animated checkboxes
Stylized checkboxes in Cirrus are animated and utilize the extended forms styling. They follow a specific DOM structure: a container withform-ext-control form-ext-checkbox, containing an input withform-ext-inputand a label withform-ext-label.<div class="form-ext-control form-ext-checkbox"> <input id="check1" class="form-ext-input" type="checkbox"> <label class="form-ext-label" for="check1">Unchecked</label> </div>Use the Cirrus UI sizing system for spacing
Cirrus UI uses a standardized sizing system for utility classes (such as padding
p-and marginm-). The numeric suffix of a class represents a value that is double the resultingremvalue. For example, a class ending in-4applies a size of2rem.Sizing Reference Table
Suffix Pixels Rem 0 0px 0rem px 1px 0.0625rem 1 8px 0.5rem 2 16px 1rem 3 24px 1.5rem 4 32px 2rem 5 40px 2.5rem 6 48px 3rem 8 64px 4rem 10 80px 5rem 12 96px 6rem 16 128px 8rem 20 160px 10rem 24 192px 12rem 32 256px 16rem <!-- Left and right padding of 1.5rem, top and bottom padding of 1rem --> <div class="px-3 py-2"> Content </div> <!-- Margin of 2.5rem on all sides --> <div class="m-5"> Content </div>