# Cherry Design System
> Full documentation for Cherry Design System.
---
# Introduction
> Cherry is a design system for the modern web. Designed in Figma, built in React using TypeScript and Styled Components.
Source: https://cherry.al/
# Cherry Design System
Cherry is a design system for the modern web. Designed in Figma, built in React using TypeScript.
In the world of design and development, consistency is key. Every page, every component, and every interaction should adhere to a set of fundamental principles. The Cherry Design System is your reliable companion for maintaining harmony between design and development.
## Why a Design System?
1. **Consistency** - A design system ensures that basic elements remain consistent across all pages. Whether it's buttons, typography, or spacing, users should experience a seamless visual language.
2. **Efficiency** - For meticulously crafted projects, a robust design system streamlines workflows. It bridges the gap between designers and developers, fostering collaboration and efficiency.
3. **Foundations** - A good design system lays down the groundwork. It establishes rules, guidelines, and best practices, allowing teams to build upon a solid foundation.
## What Cherry Offers
- **Figma Designs** - Meticulously crafted Figma designs for all the design primitives. From buttons to inputs, we've got you covered.
- **Figma Plugin** - Extract default theme tokens automatically, ensuring consistency across your entire project.
- **Open Source React Components** - Cherry provides open source React components via `cherry-styled-components` for the default implementation. Meant to be customized and built upon.
- **Theming & Dark Mode** - Fully typed light and dark themes with SSR-safe, flash-free dark mode.
Cherry intentionally focuses on providing the essential building blocks that most interfaces require. Simplicity often leads to elegance.
These docs are split in two: you are reading the **Design** section; switch to **Code** in the header for installation and the full component API.
See every component in one interactive playground.
Start with the Figma template and plugin.
Explore the color palette for light and dark modes.
Typography scales for desktop and mobile.
Shadow elevation system for depth and hierarchy.
Over 1,500 Lucide icons on a consistent grid.
Install cherry-styled-components and set up the providers.
Props and usage docs for every React component.
---
# Figma
> Get started with the Cherry Design System Figma template and plugin for extracting design tokens.
Source: https://cherry.al/figma
# Figma
When embarking on the design process, Figma is an excellent tool to kick things off.
## 1. Download the Template
Begin by obtaining the Cherry template from Figma Community. This serves as your foundation for all design work.
## 2. File Structure: Pages
The template is organized into four pages:
- **๐จ Foundations** - The design primitives, grouped into sections: **Color** (the full palette previewed in light and dark mode), **Typography** (heading and body styles at desktop and mobile sizes), and **Elevation** (shadow styles).
- **๐งฉ Components** - Reusable design elements that streamline your workflow. Every component is a variant set bound to the Figma variables, so all of them adapt to dark mode automatically: Button, IconButton, Input, Password, Textarea, Select, Checkbox, Radio, Toggle, Range, ThemeToggle, Modal, Toast, Accordion, Tabs, Dropzone, and AvatarDropzone. The section also includes the assembled Tabs component and a Box helper.
- **๐ Examples** - A sample landing page composed entirely of Cherry components, provided in light and dark mode.
- **๐ Assets** - Icons associated with a website or application: favicons, Apple touch icons, Google manifest icons, and the Open Graph social image.
## 3. Figma Variables
Cherry uses Figma variables to store design values. These values create design tokens. Variables are organized into collections:
| Variable Collection | Purpose |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **Colors** | Color values grouped into Primary, Secondary, Tertiary, Gray, and UI, with a Light Mode and a Dark Mode |
| **Font Family** | Font families for text, headings, and monospace |
| **Font Sizes** | Font size definitions with `lg` (desktop) and `xs` (mobile) modes |
| **Font Weights** | Font weights for text, headings, and buttons (Figma preview only - the extracted theme file has no font-weight tokens) |
| **Grid Gap** | Grid gaps for visually appealing layouts |
| **Line Heights** | Line height definitions with `lg` (desktop) and `xs` (mobile) modes |
| **Max Width** | Max width values for `xs` and `xxxl` |
| **Media Queries** | Breakpoints: `xs`, `sm`, `md`, `lg`, `xl`, `xxl`, `xxxl` |
| **Padding** | Padding sizes for `xs` and `lg` |
| **Radius** | Border radius for `xs`, `lg`, and `xl` |
## 4. Typography
Inside Figma, typography is driven by the Font Family, Font Sizes, Font Weights, and Line Heights variables. Adjust the definitions there and you'll see a live preview in the Typography section of the Foundations page. Keep in mind that Font Weights only affect the Figma preview: the theme file has no font-weight tokens, since weights are set directly in each component's CSS.
## 5. Local Styles
Local styles are only used for shadows. There are two sets of five elevations (`XS` to `XL`): one for light mode and one for dark mode (`Dark/XS` to `Dark/XL`). They are previewed in the Elevation section of the Foundations page.
## 6. Extract Design Tokens
Cherry has its own **Figma Plugin** to extract design tokens automatically. The plugin gives you the theme file - copy it into your app's theme file (for example `app/theme.ts`) and pass it to the theme provider. See the [Theme](/code/theme) page for how to consume a custom theme object.
---
# Colors
> Cherry's curated color palette with 18 predefined colors for light and dark themes.
Source: https://cherry.al/colors
# Colors
Cherry offers a curated set of predefined colors to kickstart your interface design. Depending on your specific requirements, you can always tweak or expand this palette. However, in most scenarios, the default palette of 18 colors should suffice.
### Primary
### Secondary
### Tertiary
### Gray
### Status
### Neutrals
In addition to the primary color palette, Cherry provides the same variables for Dark Mode. This allows seamless switching between light and dark modes with a single click in Figma.
### Primary
### Secondary
### Tertiary
### Gray (Dark Mode)
### Status
### Neutrals (Inverted)
## Using the tokens
Every color above is available as a token on the theme object, so you can reference it by name in any styled-component:
```tsx
const Title = styled.h2`
color: ${({ theme }) => theme.colors.primary};
`;
```
To use these colors in code, see the [Theme](/code/theme) and [Dark Mode](/code/dark-mode) pages.
Colors can be found in the Figma Template in the Color section of the
Foundations page.
---
# Typography
> Cherry's responsive typography system with definitions for desktop and mobile breakpoints.
Source: https://cherry.al/typography
# Typography
Cherry offers two distinct sets of typography definitions: one for desktop and another for mobile. These comprehensive definitions ensure that type displays correctly on screens of all sizes. The **Desktop (LG)** values apply from the `lg` breakpoint (992px) and up, while the **Mobile (XS)** values are the base scale used on narrower screens.
| Style | Font | Size | Line Height | Weight |
| ------------ | ----- | ----- | ----------- | ------ |
| Hero1 | Inter | 128px | 1.1 | 700 |
| Hero2 | Inter | 96px | 1.1 | 700 |
| Hero3 | Inter | 72px | 1.1 | 700 |
| H1 | Inter | 60px | 1.4 | 700 |
| H2 | Inter | 36px | 1.5 | 700 |
| H3 | Inter | 30px | 1.5 | 700 |
| H4 | Inter | 24px | 1.5 | 700 |
| H5 | Inter | 20px | 1.5 | 700 |
| H6 | Inter | 18px | 1.6 | 700 |
| Text | Inter | 16px | 1.7 | 400 |
| Strong | Inter | 16px | 1.7 | 700 |
| Small | Inter | 14px | 1.7 | 400 |
| Blockquote | Inter | 18px | 1.7 | 400 |
| Code | Mono | 16px | 1.7 | 400 |
| Button Small | Inter | 14px | 1.0 | 600 |
| Button | Inter | 16px | 1.0 | 600 |
| Button Big | Inter | 18px | 1.0 | 600 |
| Input Small | Inter | 14px | 1.0 | 400 |
| Input | Inter | 16px | 1.0 | 400 |
| Input Big | Inter | 18px | 1.0 | 400 |
| Style | Font | Size | Line Height | Weight |
| ------------ | ----- | ---- | ----------- | ------ |
| Hero1 | Inter | 72px | 1.1 | 700 |
| Hero2 | Inter | 60px | 1.1 | 700 |
| Hero3 | Inter | 36px | 1.2 | 700 |
| H1 | Inter | 40px | 1.5 | 700 |
| H2 | Inter | 30px | 1.5 | 700 |
| H3 | Inter | 28px | 1.3 | 700 |
| H4 | Inter | 26px | 1.3 | 700 |
| H5 | Inter | 18px | 1.6 | 700 |
| H6 | Inter | 16px | 1.6 | 700 |
| Text | Inter | 14px | 1.7 | 400 |
| Strong | Inter | 14px | 1.7 | 700 |
| Small | Inter | 12px | 1.7 | 400 |
| Blockquote | Inter | 16px | 1.7 | 400 |
| Code | Mono | 14px | 1.7 | 400 |
| Button Small | Inter | 14px | 1.0 | 600 |
| Button | Inter | 16px | 1.0 | 600 |
| Button Big | Inter | 18px | 1.0 | 600 |
| Input Small | Inter | 14px | 1.0 | 400 |
| Input | Inter | 16px | 1.0 | 400 |
| Input Big | Inter | 18px | 1.0 | 400 |
The Weight column is part of the design spec. In code, the typography mixins
only set `font-size` and `line-height`, so heading weights come from the
browser's bold defaults for `h1` to `h6` unless you set `font-weight`
yourself. The Button (600) and Input (400) components set their own weights.
## Usage
Nearly every style above is available as a ready-made CSS mixin exported from `cherry-styled-components`: `styledHero1`, `styledHero2`, `styledHero3`, `styledH1` through `styledH6`, `styledText`, `styledStrong`, `styledSmall`, `styledBlockquote`, `styledCode`, `styledButton`, `styledButtonBig`, `styledInput`, and `styledInputBig`. Each mixin takes the theme and returns the responsive `font-size` and `line-height`, switching from the mobile to the desktop values at the `lg` breakpoint:
```tsx
import styled from "styled-components";
import { styledH1 } from "cherry-styled-components";
const Title = styled.h2`
${({ theme }) => styledH1(theme)}
`;
```
For scales without a dedicated mixin (like Button Small and Input Small) or for custom theme keys, use the `createTypographyStyle` factory, e.g. `createTypographyStyle("buttonSmall")`.
To apply these styles in code, use the exported [typography
helpers](/code/typography), and see [Theme](/code/theme) for font tokens.
Styles can be found in the Figma Template in the Typography section of the
Foundations page.
---
# Shadows
> Cherry's shadow elevation system with five levels for light and dark modes.
Source: https://cherry.al/shadows
# Shadows
Cherry offers several shadow variations that allow you to create elevations and add depth to your interfaces. Shadows play a crucial role in enhancing the visual hierarchy of elements, providing a sense of depth and realism.
There are two sets of shadows, one for dark mode and one for light mode.
| Level | Value |
| ------ | ---------------------------------------------------------------------------- |
| **xs** | `0px 4px 4px 0px rgba(18,18,18,0.04), 0px 1px 3px 0px rgba(39,41,45,0.02)` |
| **sm** | `0px 4px 4px 0px rgba(18,18,18,0.08), 0px 1px 3px 0px rgba(39,41,45,0.04)` |
| **md** | `0px 8px 8px 0px rgba(18,18,18,0.16), 0px 2px 3px 0px rgba(39,41,45,0.06)` |
| **lg** | `0px 16px 24px 0px rgba(18,18,18,0.20), 0px 2px 3px 0px rgba(39,41,45,0.08)` |
| **xl** | `0px 24px 32px 0px rgba(18,18,18,0.24), 0px 2px 3px 0px rgba(39,41,45,0.12)` |
| Level | Value |
| ------ | ---------------------------------------------------------------------------------- |
| **xs** | `0px 4px 4px 0px rgba(255,255,255,0.04), 0px 1px 3px 0px rgba(255,255,255,0.02)` |
| **sm** | `0px 4px 4px 0px rgba(255,255,255,0.08), 0px 1px 3px 0px rgba(255,255,255,0.04)` |
| **md** | `0px 8px 8px 0px rgba(255,255,255,0.16), 0px 2px 3px 0px rgba(255,255,255,0.06)` |
| **lg** | `0px 16px 24px 0px rgba(255,255,255,0.20), 0px 2px 3px 0px rgba(255,255,255,0.08)` |
| **xl** | `0px 24px 32px 0px rgba(255,255,255,0.24), 0px 2px 3px 0px rgba(255,255,255,0.12)` |
## Usage
Shadows live on the theme object under `theme.shadows`, keyed by level (`xs`, `sm`, `md`, `lg`, `xl`). Reference them in your styled components and the matching set is applied automatically in light and dark mode:
```tsx
import styled from "styled-components";
const Card = styled.div`
box-shadow: ${({ theme }) => theme.shadows.md};
`;
```
The raw values are also exported as `shadows` and `shadowsDark` from `cherry-styled-components` if you need them outside the theme.
Shadow tokens live on the theme object; see [Theme](/code/theme) for setup.
Shadows can be found in the Figma Template in the Elevation section of the
Foundations page.
---
# Icons
> Cherry uses the Lucide icon set - over 1,500 consistent, open-source icons available in every component.
Source: https://cherry.al/icons
# Icons
Cherry uses [Lucide](https://lucide.dev), an open-source icon set with over 1,500 icons drawn on a consistent 24x24 grid with a 2px rounded stroke. Leaning on one primary set keeps iconography coherent across your interface, and the outline style pairs naturally with Cherry's borders and typography.
Lucide icons inherit the current text color, so they adapt to light and dark mode automatically along with the component they sit in.
## Where icons appear
Several Cherry components ship with built-in Lucide icons:
- **Accordion** - the rotating chevron (`ChevronDown`)
- **Modal** - the close button (`X`)
- **Toast** - a per-status icon (`CircleCheck`, `CircleX`, `TriangleAlert`, `Info`) plus the dismiss button (`X`)
- **Password** - the visibility toggle (`Eye`, `EyeOff`)
- **ThemeToggle** - the sun and moon (`Sun`, `MoonStar`)
- **Dropzone / AvatarDropzone** - the drop-area glyph, customizable via the `$icon` prop (Dropzone defaults to `FileUp`, AvatarDropzone to `User`); Dropzone's file thumbnails also use `File` and `X`
- **Input** - the checkbox check mark (`Check`) and the calendar glyph on date and time inputs (`CalendarDays`)
- **Select** - the dropdown arrow (`ChevronDown`)
- **IconButton** - accepts any icon as its content
## Choosing icons
Browse the full set at [lucide.dev/icons](https://lucide.dev/icons). Icons are referenced by their PascalCase name (for example `Settings`, `Trash2`, `ImageUp`). In code, render them with the [Icon](/code/icon) component; designers can use the official [Lucide Figma plugin](https://www.figma.com/community/plugin/939567362549682242/lucide-icons) to place the same icons in mockups.
```jsx
import { Icon } from "cherry-styled-components";
;
```
Keep icon usage purposeful: prefer familiar glyphs for common actions
(pencil for edit, trash for delete) and pair less obvious icons with a
visible label.
---
# Buttons
> Cherry button design specifications with three variations, sizes, outline variants, icon buttons, and all interactive states.
Source: https://cherry.al/buttons
# Buttons
Cherry offers three color variations of buttons: Primary, Secondary, and Tertiary. Each variation comes in three sizes (Small, Default, and Big) with optional outline styling.
## States
When customizing your designs, consider all the different states that buttons can have:
1. **Normal** - The default appearance of the button.
2. **Hover** `:hover` - When the user hovers the cursor over the button.
3. **Active** `:active` - When the button is clicked or pressed.
4. **Focus** `:focus` - When the button gains focus.
5. **Disabled** - When the button cannot be interacted with.
Ensure that your designs account for all these states to provide a consistent
and user-friendly experience.
## Variations
Beyond the color variations below, regular buttons also support a full-width option that stretches the button to the full width of its container, an error variant for destructive actions (available in both filled and outline styles), and inline icons placed on either side of the label.
### Primary
| Size | Filled | Outline | Disabled |
| ------- | ------ | ------- | -------- |
| Small | Yes | Yes | Yes |
| Default | Yes | Yes | Yes |
| Big | Yes | Yes | Yes |
### Secondary
| Size | Filled | Outline | Disabled |
| ------- | ------ | ------- | -------- |
| Small | Yes | Yes | Yes |
| Default | Yes | Yes | Yes |
| Big | Yes | Yes | Yes |
### Tertiary
| Size | Filled | Outline | Disabled |
| ------- | ------ | ------- | -------- |
| Small | Yes | Yes | Yes |
| Default | Yes | Yes | Yes |
| Big | Yes | Yes | Yes |
## Icon Buttons
Icon buttons are circular, icon-only buttons for compact actions like edit, delete, or settings. They come in three sizes (24px, 28px, and 32px) and support all interactive states, an error variant for destructive actions, and an active "on" state (primary border with a translucent primary tint) for toggle-like actions such as an open dropzone or an active preview.
Because icon buttons have no visible text, every icon button requires an `aria-label` describing its action. The active "on" state is exposed to assistive technology as `aria-pressed`.
| Size | Default | Error | Active | Disabled |
| ------- | ------- | ----- | ------ | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Ready to build? See the [Button](/code/button) and
[IconButton](/code/icon-button) component docs for props and usage examples.
Buttons can be found in the Figma Template in the Components page, alongside
the IconButton component set.
---
# Inputs
> Cherry input design specifications covering text fields, password fields, checkboxes, radios, toggles, range sliders, and dropzones.
Source: https://cherry.al/inputs
# Inputs
Cherry offers several variations for input elements. Inputs facilitate user interaction with applications. While there are no color variations for inputs, Cherry provides three sizes: Small, Default, and Big. Inputs can have error or success states to provide feedback to the user.
## States
When customizing your designs, consider all the different states:
1. **Normal** - The default appearance of the input.
2. **Hover** `:hover` - When the user hovers the cursor over the input.
3. **Active** `:active` - When the input is clicked or pressed.
4. **Focus** `:focus` - When the input gains focus.
5. **Checked** `:checked` - Depending on the type of input, additional states may apply.
6. **Disabled** - When the input cannot be interacted with.
Ensure that your designs account for all these states to provide a consistent
and user-friendly experience.
## Text Input
| Size | Default | Success | Error | Disabled |
| ------- | ------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Implementation: [Input](/code/input)
## Password
Password fields extend the text input with a reveal toggle pinned inside the field. The revealed state swaps the masked dots for plain text and flips the eye icon.
| Size | Default | Revealed | Success | Error | Disabled |
| ------- | ------- | -------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes | Yes |
Implementation: [Password](/code/password)
## Textarea
Textareas are multi-line text fields for longer content. They share the text input's border, focus ring, and status states.
| Size | Default | Success | Error | Disabled |
| ------- | ------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Implementation: [Textarea](/code/textarea)
## Select
Selects are dropdown pickers styled to match the text input, with an arrow indicator that flips while the select is focused or open.
| Size | Default | Success | Error | Disabled |
| ------- | ------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Implementation: [Select](/code/select)
## Checkbox
| Size | Default | Success | Error | Disabled |
| ------- | ------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Implementation: [Input](/code/input)
## Radio
| Size | Default | Success | Error | Disabled |
| ------- | ------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Implementation: [Input](/code/input)
## Toggle
| Size | Default | Success | Error | Disabled |
| ------- | ------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Implementation: [Toggle](/code/toggle)
## Range
| Size | Default | Success | Error | Disabled |
| ------- | ------- | ------- | ----- | -------- |
| Small | Yes | Yes | Yes | Yes |
| Default | Yes | Yes | Yes | Yes |
| Big | Yes | Yes | Yes | Yes |
Implementation: [Range](/code/range)
## Dropzone
Dropzones are file inputs rendered as dashed drop targets, with a compact inline variant for embedding in forms and modals.
| Variant | Default | Drag Over | Disabled |
| ------- | ------- | --------- | -------- |
| Block | Yes | Yes | Yes |
| Inline | Yes | Yes | Yes |
Implementation: [Dropzone](/code/dropzone)
## Avatar Dropzone
Avatar dropzones are circular, single-file dropzones for profile pictures. The circle is dashed while empty and shows the selected picture with a corner remove button once filled.
| Size | Empty | Filled | Drag Over | Disabled |
| -------------- | ----- | ------ | --------- | -------- |
| Small (64px) | Yes | Yes | Yes | Yes |
| Default (96px) | Yes | Yes | Yes | Yes |
| Big (128px) | Yes | Yes | Yes | Yes |
Implementation: [AvatarDropzone](/code/avatar-dropzone)
Inputs can be found in the Figma Template in the Components page, alongside
the Password, Dropzone, and AvatarDropzone component sets.
---
# Accordions
> Cherry accordion design specifications with card and inline variants.
Source: https://cherry.al/accordions
# Accordions
Accordions show and hide content behind a clickable title, keeping dense pages scannable. The chevron rotates to mirror the open state, and the open and close motion is animated.
## States
When customizing your designs, consider all the different states that accordions can have:
1. **Normal** - The default appearance of the accordion.
2. **Hover** `:hover` - When the user hovers the cursor over the title.
3. **Focus** - When the accordion title gains focus.
4. **Open / Closed** - The content expands or collapses, and the chevron rotates to match.
Ensure that your designs account for all these states to provide a consistent
and user-friendly experience.
## Variations
| Variation | Open | Closed |
| --------- | ---- | ------ |
| Card | Yes | Yes |
| Inline | Yes | Yes |
- **Card** - A bordered, rounded surface with generous padding. Use it when the accordion stands on its own.
- **Inline** - No border, radius, or side padding. Use it inside cards, lists, or other surfaces that already provide their own container. Enabled in code with the `$inline` prop.
In code, both variations use the same `Accordion` component:
```jsx
import { Accordion } from "cherry-styled-components";
Content;
```
The accordion manages its own open state and starts closed; use `defaultOpen` to start it open, or pass `open` together with `onToggle` to control it from the parent.
Ready to build? See the [Accordion](/code/accordion) component docs for props
and usage examples.
Accordions can be found in the Figma Template in the Components page.
---
# Tabs
> Cherry tabs design specifications with tab states and panel styling.
Source: https://cherry.al/tabs
# Tabs
Tabs group related content into panels behind a horizontal list of triggers. The active tab is highlighted with the primary color and a bottom indicator, and the panel below shares the same bordered, rounded surface as cards and accordions.
## States
When customizing your designs, consider all the different states that a tab trigger can have:
1. **Normal** - The resting appearance of an unselected tab.
2. **Hover** `:hover` - The label turns primary over a subtle primary tint.
3. **Focus** `:focus-visible` - A rounded primary outline inset within the tab for keyboard users. While a tab is focused, the ring replaces the selected tab's bottom indicator.
4. **Selected** - Primary label with a 3px primary bottom indicator.
Ensure that your designs account for all these states to provide a consistent
and user-friendly experience.
Ready to build? See the [Tabs](/code/tabs) component docs for props and usage
examples.
Tabs can be found in the Figma Template in the Components page as the Tab
component set and the assembled Tabs component.
---
# Overlays
> Cherry overlay design specifications for modals and toast notifications.
Source: https://cherry.al/overlays
# Overlays
Overlays sit on top of the page to demand attention or give feedback. Cherry provides two overlay elements: the Modal for blocking dialogs and the Toast for transient notifications.
## States
Both overlays are dismissed through an icon button: the close button on the Modal and the dismiss button on the Toast. When customizing your designs, consider all the different states these controls can have:
1. **Normal** - The default appearance of the control.
2. **Hover** `:hover` - When the user hovers the cursor over the control.
3. **Active** `:active` - When the control is clicked or pressed.
4. **Focus** `:focus` - When the control gains focus.
Ensure that your designs account for all these states to provide a consistent
and user-friendly experience.
## Modal
The modal is a centered dialog on a primary-tinted backdrop. It has an optional title with a divider, scrollable content, and a close icon button in the corner.
| Variant | Included |
| ------------- | -------- |
| With title | Yes |
| Without title | Yes |
The dialog caps at 500px wide on large screens; a custom width (`$width`) overrides that cap. The close button can be hidden (`$hideCloseButton`) when the flow should own dismissal. For app-level restyling, the overlay accepts `className` and `style`, and the inner parts expose stable class hooks: `.modal-inner`, `.modal-close`, `.modal-title`, and `.modal-content`.
When designing modal flows, account for the three ways users dismiss it (two when the close button is hidden):
1. **Close button** - The icon button in the top-right corner.
2. **Escape** - Pressing the Escape key.
3. **Outside click** - Clicking the backdrop.
## Toast
Toasts are pill-shaped notifications with a semantic status icon, a message, and a close button. They stack vertically and animate in and out.
| Color | Icon | Use for |
| ------- | -------------- | -------------------------- |
| Info | Info | Neutral information |
| Success | Circle check | Completed actions |
| Error | Circle x | Failures |
| Warning | Triangle alert | Situations needing caution |
By default the stack is anchored to the top of the viewport and centered horizontally. It can be aligned left, center, or right (`$align`) and anchored to the bottom instead (`$bottom`); toasts slide in from the edge the stack is anchored to. When no color is given, a toast defaults to Info.
Toasts are persistent by default: auto-hide (`autoHide`) is a duration in milliseconds that defaults to 0, meaning off, so a toast stays on screen until the user dismisses it. Pass a duration to have the toast dismiss itself.
Reserve persistent toasts (without auto-hide) for messages that require the
user's acknowledgment. Transient confirmations should dismiss themselves.
In code, the Modal is controlled through its `$isOpen` and `$onClose` props. Toast is context-driven: wrap the app in `ToastNotificationsProvider`, render the `ToastNotifications` outlet once, and push messages with `useToastNotifications().addNotification`.
Ready to build? See the [Modal](/code/modal) and [Toast](/code/toast)
component docs for props and usage examples.
Modal and Toast can be found in the Figma Template in the Components page.
---
# Site Images
> Icons and thumbnail specifications for favicons, Apple Touch Icons, Google Manifest Icons, and social images.
Source: https://cherry.al/site-images
# Site Images
When designing interfaces for web applications, it's essential to include icons and thumbnails. These visual elements enhance user experience and provide a professional look.
## Image Types
Sizes: 32x32px (standard) and 16x16px (small). Favicons appear in browser tabs, bookmarks, and other places where your website is listed. They help users quickly identify your site.
Size: 180x180px. These icons are specifically for iOS devices. When users add your website to their home screen, this icon is displayed.
Sizes: 256x256px and 192x192px. The manifest file specifies how your web app should behave when installed on an Android device. For full PWA installability, also include a 512x512px icon, since Chrome and Lighthouse expect the 192x192px and 512x512px pair.
Size: Around 1280x670px. This is the open graph image that serves as a preview when your website is shared on social media platforms. Make sure the image represents your site well and encourages users to click through.
Remember to include these icons and images in your project to create a cohesive and professional appearance for your web application.
Site images can be found in the Figma Template in the Assets page.
---
# Overview
> Get started with Cherry's React components built with Styled Components and TypeScript.
Source: https://cherry.al/code
# Develop
Every component in the **Cherry Design System** is meticulously crafted using **React** and **Styled Components**. These building blocks empower you to create delightful user interfaces.
## Components
Show and hide content behind a clickable, animated title.
Circular single-file dropzone for profile pictures.
The gateway to interaction. Various styles and states.
File drop target with drag & drop, validation, and previews.
Render any Lucide icon by name.
Circular icon-only button for compact actions.
Text fields, checkboxes, radio buttons - everything input-related.
Animated dialog with Escape and outside-click dismissal.
Password input with a built-in show/hide reveal toggle.
Sliders for numeric input.
Dropdown menus for options.
Accessible tabbed panels with keyboard navigation.
Multiline text input for longer messages.
Pill-shaped sun/moon switch for light and dark mode.
Transient notifications with semantic colors and auto-hide.
Simplify binary choices.
## Layout
The versatile container for layout, spacing, or as a wrapper.
Create responsive column layouts with ease.
A container for your content.
Arrange items horizontally or vertically.
Build grids effortlessly using CSS grid.
Control the maximum width of your content.
Responsive vertical or horizontal spacing between elements.
## Cherry Helpers
Consistency across your app. Define global rules here.
Utility hooks like `useOnClickOutside` for floating UI.
Reusable code snippets. Efficiency meets elegance.
Define spacings, colors, typography, and more.
Basic icons for elements like checkbox and dropdown arrow.
Text matters. Set font styles and sizes effortlessly.
## Styled Components Helpers
- **[StyledComponentsRegistry](/code/installation)** - Renders CSS in your Next.js app.
- **[CherryThemeProvider](/code/installation)** - Wrap your app with the Cherry Theme context.
- **[ClientThemeProvider](/code/dark-mode)** - SSR-aware theme provider for flash-free dark mode.
- **[themeInitScript / createThemeInitScript](/code/dark-mode)** - Blocking head script that prevents the dark-mode flash.
- **[resolveTheme](/code/dark-mode)** - Resolve the `theme` cookie to a theme object in server code.
- **[ThemeContext](/code/dark-mode)** - Access `setTheme` and `toggleTheme` for custom theme controls.
## Next Steps
See every component in one interactive playground.
Get started with development.
Flash-free dark mode with SSR support.
Release notes for every version.
---
# Installation
> Install Cherry Styled Components via npm or by cloning the repository.
Source: https://cherry.al/code/installation
# Installation
There are two main ways to install Cherry Styled Components into your project. You can either clone the main repository and customize the components to your liking, or install the library from npm.
## Implementation Options
Install the Cherry library from npm along with its peer dependencies. Import components directly into your project. Perfect for smaller projects or rapid development. The library requires `react` and `react-dom` (^18 or ^19) and `styled-components` (^6) as peer dependencies.
Clone the main Cherry repository. Dive into the components' code and customize to your heart's content. Ideal for extensive modifications.
```bash
git clone git@github.com:cherry-design-system/styled-components.git
```
## Theme Context
Always wrap your application in the `CherryThemeProvider` component. Ensure that your theme prop is passed down correctly. For server-rendered apps that need flash-free dark mode, use `ClientThemeProvider` instead - see [Dark Mode](/code/dark-mode).
```tsx
import { CherryThemeProvider, theme } from "cherry-styled-components";
export default function App({ children }) {
return {children};
}
```
## Next.js Integration
When integrating into a Next.js app, first install the dependencies:
Next, enable the styled-components compiler in your `next.config.ts`. This keeps class names deterministic between server and client renders and avoids hydration mismatches:
To render the CSS, open your `layout.tsx` and wrap your application. The `StyledComponentsRegistry` component injects the server-rendered styles into the HTML via `useServerInsertedHTML`, so styled-components work with server-side rendering and the App Router:
) {
return (
{children}
);
}`} />
Next.js requires these additional steps because it uses server-side rendering.
---
# Skill for AI Agents
> Teach Claude and other coding agents to build with Cherry correctly using the official Agent Skill.
Source: https://cherry.al/code/skill-for-ai-agents
# Skill for AI Agents
Cherry ships an official AI-assistant skill that teaches Claude and other coding agents to build with the library correctly: reach for a Cherry component for every button and form control, read design values from the theme instead of hardcoding them, and wire up the provider. Drop it into your project and your assistant stops guessing.
It is a [Claude Agent Skill](https://docs.claude.com/en/docs/claude-code/skills) - a `SKILL.md` plus on-demand `references/` covering setup, theme tokens, the full component API, and recipes - and it lives in the [`skills/cherry-design-system`](https://github.com/cherry-design-system/styled-components/tree/main/skills/cherry-design-system) folder of the library repo.
## Install
The [`skills` CLI](https://github.com/vercel-labs/skills) is the recommended, cross-agent path. It installs into the right directory for Claude Code, Cursor, Codex, and many other agents, detecting yours automatically.
Preview what would be installed with `--list`, update later with `npx skills update cherry-design-system`, and remove it with `npx skills remove cherry-design-system`.
An Agent Skill is just a folder. Copy it into your skills directory - project-level to share it with your team, or personal for all your projects. Keep the `references/` folder alongside `SKILL.md`.
```bash
# project-level (committed, shared with your team)
cp -r cherry-design-system .claude/skills/
# or personal (all your projects)
cp -r cherry-design-system ~/.claude/skills/
```
For Cursor, Codex, Zed, and other tools that read a single guide file, copy the skill's self-contained `AGENTS.md` to your repository root (or append it to an existing `AGENTS.md`). It condenses the same rules into one file; the `references/` load on demand.
## What the skill enforces
Once installed, the assistant follows Cherry's rules instead of improvising:
- **Every button is a Cherry `