# Sabil UI — full documentation > A set of beautifully crafted, accessible components with a calm, tactile design foundation. Open code. Copy it, own it, ship it. Site: https://ui.muttaqinsabilul.my.id # AI & LLMs Rules for AI assistants building UI with Sabil UI. Docs: https://ui.muttaqinsabilul.my.id/docs · Components: https://ui.muttaqinsabilul.my.id/docs/components · Tokens: https://ui.muttaqinsabilul.my.id/tokens.json ## Stack - React with Tailwind CSS v4 and Radix UI primitives. Components live in `@/components/ui/` and are imported by name, e.g. `import { Button } from "@/components/ui/button"`. - Merge class names with `cn` from `@/lib/utils`. - Icons come from `lucide-react`. Inside buttons, icons are 16px and need no size class. - Motion: CSS for press, hover and overlays; the `motion` package (`import { motion } from "motion/react"`) for springs, gestures, exit and layout animation. - Without React or Tailwind, use the plain edition: `sabil.css` + `sabil.js` with `s-*` classes (see /docs/html-css). ## Use tokens, never raw values Always use the semantic Tailwind classes below. Never hard-code hex colors, pixel radii or shadows. | Purpose | Class | Light | Dark | | --- | --- | --- | --- | | Page background | bg-background | #ffffff | #0a0a0a | | Text | text-foreground | #0a0a0a | #fafafa | | Secondary text | text-muted-foreground | #45556c | #a1a1a6 | | Primary action (blue) | bg-primary / text-primary | #056dff | #2b7bff | | Subtle fill, tracks | bg-muted / bg-secondary | #f1f5f9 | #1d1d1f | | Hover fill | bg-accent | #0a0a0a 4% | #ffffff 6% | | Hairline | border / border-border | #0a0a0a 8% | #ffffff 9% | | Danger | bg-destructive / text-destructive | #e7000b | #ff6467 | | Cards, popovers | bg-card / bg-popover | #ffffff | #121212 / #161616 | | Warm preview panel | bg-panel | #f9f8f6 | #1a1918 | ## Size and shape | Element | Value | Class | | --- | --- | --- | | Buttons, inputs, selects (default) | 40px high | built into the components | | Small controls | 32px high | size="sm" | | Tab trigger | 7.5px radius | rounded-md | | Controls, menu items | 10px radius | rounded-lg | | Menus, popovers, dialogs, cards | 15px radius | rounded-xl | | Large cards, chat bubbles | 20px radius | rounded-2xl | | Font | Inter; Geist Mono for code | font-sans / font-mono | | Body text | 14px | text-sm | | Button text | 14px, 500, -0.01em tracking | built in | | Headings | semibold, tight tracking | font-semibold tracking-tight | ## Surfaces - Primary actions use ` ) } ``` --- # Introduction A set of beautifully crafted, accessible components with a calm, tactile design foundation. Open code. Copy it, own it, ship it. Sabil UI is a collection of components you copy into your app and own. It is built on Radix primitives and Tailwind CSS v4, with its own design foundation. ## Principles - Open code: every component is a file in your project. - One foundation: color, radius, depth and motion live in tokens. - Tactile surfaces: primary actions use a blue gradient with a 1px inner edge; secondary actions sit on a raised white surface. - Fast by default: short, purposeful motion. ## Editions - React + Tailwind: https://ui.muttaqinsabilul.my.id/docs/components - Plain HTML, CSS & JS: https://ui.muttaqinsabilul.my.id/docs/html-css - Rules for AI assistants: https://ui.muttaqinsabilul.my.id/docs/ai --- # Installation Set up Next.js, Tailwind CSS v4 and the foundation, then add components. 1. Create a Next.js app with Tailwind CSS v4: ```bash npx create-next-app@latest my-app --typescript --tailwind --app ``` 2. Install the base dependencies: ```bash npm install radix-ui class-variance-authority cn lucide-react tw-animate-css next-themes ``` 3. Replace `app/globals.css` with the foundation (https://ui.muttaqinsabilul.my.id/r/theme.json contains both files: `globals.css` and `variants.css`). 4. Add the cn helper: ```ts export { cn } from "cn" ``` 5. Add components: copy the source from https://ui.muttaqinsabilul.my.id/r/.json (field `files[].content`) into `components/ui/.tsx` and install its `dependencies`. --- # Theming Every visual decision lives in a CSS variable. Every visual decision lives in a CSS variable in `app/globals.css`. Components only read tokens. ## Colors | Token | Light | Dark | | --- | --- | --- | | --background | #ffffff | #0a0a0a | | --foreground | #0a0a0a | #fafafa | | --card | #ffffff | #121212 | | --card-foreground | #0a0a0a | #fafafa | | --popover | #ffffff | #161616 | | --popover-foreground | #0a0a0a | #fafafa | | --primary | #056dff | #2b7bff | | --primary-foreground | #ffffff | #ffffff | | --secondary | #f1f5f9 | #1d1d1f | | --secondary-foreground | #0f172b | #fafafa | | --muted | #f1f5f9 | #1d1d1f | | --muted-foreground | #45556c | #a1a1a6 | | --accent | #0a0a0a0a | #ffffff0f | | --accent-foreground | #0a0a0a | #fafafa | | --destructive | #e7000b | #ff6467 | | --border | #0a0a0a14 | #ffffff17 | | --input | #0a0a0a1f | #ffffff24 | | --ring | #056dff | #3c86ff | | --chart-1 | #056dff | #3c86ff | | --chart-2 | #3c86ff | #6aa6ff | | --chart-3 | #8ec5ff | #8ec5ff | | --chart-4 | #1447e6 | #1f63e8 | | --chart-5 | #bedbff | #bedbff | | --sidebar | #fafafa | #0f0f0f | | --sidebar-foreground | #0a0a0a | #fafafa | | --sidebar-primary | #056dff | #3c86ff | | --sidebar-primary-foreground | #ffffff | #ffffff | | --sidebar-accent | #0a0a0a0a | #ffffff0f | | --sidebar-accent-foreground | #0a0a0a | #fafafa | | --sidebar-border | #0a0a0a14 | #ffffff17 | | --sidebar-ring | #056dff | #3c86ff | | --primary-highlight | #4a8fff | #5c9bff | | --primary-edge | #0a58d6 | #1d5fd9 | | --surface-edge | #00000040 | #00000080 | | --overlay-border | #0a0a0a0f | #ffffff14 | | --panel | #f9f8f6 | #1a1918 | | --bubble | #0a0a0a0a | #ffffff0f | | --bubble-strong | #0a0a0a14 | #ffffff1f | | --raised | #ffffff | #1d1d1f | | --sunken | #f1f5f9 | #1d1d1f | | --dot | #0a0a0a1f | #ffffff1a | | --shadow-color | #0000000d | #00000066 | ## Radius `--radius: 0.625rem` (10px). Scale: sm 5px, md 7.5px (tab trigger), lg 10px (controls, menu items), xl 15px (menus, popovers, dialogs), 2xl 20px (cards, bubbles). ## Surfaces - `surface-primary`: vertical gradient from `--primary-highlight` (#4a8fff) to `--primary` (#056dff), a soft top sheen, a 1px `--primary-edge` ring, lit top and shaded bottom edges, a blue-tinted shadow. - `surface-raised`: white control with a hairline ring and 0 1px 2px shadow. - `surface-sunken`: flat slate track. - `bg-dots`: dotted canvas. ## Typography Inter for interface text, Geist Mono for code. Body 14px. Buttons 14px/500 with -0.01em tracking. Headings semibold with tight tracking. Machine-readable: https://ui.muttaqinsabilul.my.id/tokens.json --- # Dark Mode Dark mode swaps token values under a .dark class. Use `next-themes` with `attribute="class"` and add `suppressHydrationWarning` to ``. ```tsx {children} ``` Plain HTML edition: add `class="dark"` or `data-theme="dark"` to ``. --- # MCP Server Remote MCP server for Claude Code, Cursor and VS Code. Sabil UI has a remote MCP server. Add one URL to your AI tool and it can read the rules, components, tokens and motion patterns on demand. No install, no API key. URL: https://ui.muttaqinsabilul.my.id/mcp ## Setup ### Claude Code Run once in your terminal. Add --scope project to share it with your team through .mcp.json. ```bash claude mcp add --transport http sabil-ui https://ui.muttaqinsabilul.my.id/mcp ``` ### Cursor Add to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every project. ```json { "mcpServers": { "sabil-ui": { "url": "https://ui.muttaqinsabilul.my.id/mcp" } } } ``` ### VS Code Add to .vscode/mcp.json, then click Start above the server. Works with GitHub Copilot in agent mode. ```json { "servers": { "sabil-ui": { "type": "http", "url": "https://ui.muttaqinsabilul.my.id/mcp" } } } ``` ### Claude Desktop & claude.ai Settings → Connectors → Add custom connector. Name it Sabil UI and paste the URL. ```text https://ui.muttaqinsabilul.my.id/mcp ``` ## Tools | Tool | What it returns | | --- | --- | | get_rules | Design rules to follow. Assistants call this first. | | list_components | Every component with a one-line description. | | get_component | Import line and example for one component; detail "full" adds its source and all examples. | | get_component_source | Files to write into a project, with npm and internal dependencies. | | get_tokens | All design tokens as W3C Design Tokens JSON. | | get_setup | Project setup and the foundation CSS. | | get_motion | Motion foundations, or one of 16 animation patterns with code. | | get_html_edition | The plain HTML, CSS & JS edition. | | search_docs | Find components and guides by keyword. | ## Try - Build a pricing page with Sabil UI. - Add a Sabil UI dialog to edit the user profile in this project. - Which Sabil UI component should I use for picking a date range? - Animate this list with the Sabil UI stagger pattern. --- # HTML, CSS & JS Sabil UI without React or Tailwind. Same foundation as one CSS file and one dependency-free script. No React, no Tailwind, no build step. ```html … ``` Classes start with `s-`, tokens with `--s-`, attributes with `data-s-`. Dark mode: `class="dark"` on ``. ## JavaScript API ```javascript Sabil.toast({ title, description, variant: "destructive", action: { label, onClick } }) Sabil.openDialog(id); Sabil.closeDialog(id) Sabil.init(container) // after inserting tabs or comboboxes // events: "s-select" (menu), "s-change" (tabs, combobox) ``` ## Components (CSS only) ### Button Primary uses the blue gradient surface. Add a modifier for other variants and sizes. ```html
``` ### Input & Field Wrap a label, control and hint in s-field. Set aria-invalid for the error state. ```html

We never share your email.

Use at least 8 characters.

``` ### Textarea & Select Native elements with the same border, radius and focus ring as the input. ```html
``` ### Checkbox, Radio & Switch Native inputs restyled. Keyboard and form support come for free. ```html
``` ### Segmented Control Tabs without JavaScript, built on radio inputs. Use a shared name per group. ```html
``` ### Badge Small status labels. ```html
New Draft v2.4.0 Failed
``` ### Card Header, content and footer. Any element works inside. ```html

Upgrade to Pro

Unlimited projects and priority support.

$24/month

``` ### Alert A callout with an optional icon. ```html

A new version is available

Reload the page to get the latest features.

``` ### Avatar Initials or an image. Group them with s-avatar-group. ```html
ML JR
AL MK SN +5
``` ### Accordion Native
. Opens and closes without JavaScript, and stays accessible. ```html
What is your return policy?
Return any item within 30 days for a full refund.
How long does shipping take?
Standard shipping takes 3–5 business days.
Do you ship internationally?
Yes, to over 40 countries.
``` ### Table Readable defaults for tabular data. ```html
InvoiceStatusMethodAmount
INV-001PaidCard$250.00
INV-002PendingTransfer$150.00
INV-003FailedCard$350.00
``` ### Breadcrumb & Pagination Mark the current page with aria-current. ```html
``` ### Progress, Skeleton & Spinner Loading states. The skeleton shimmer and spinner stop when reduced motion is on. ```html
60%
``` ### Tooltip & Kbd A CSS-only tooltip from the data-s-tooltip attribute. It waits 300ms before showing. ```html
Search CtrlK
``` ### Empty State A placeholder for lists with nothing in them yet. ```html

No projects yet

Create your first project to start collaborating with your team.

``` ## Interactive (needs sabil.js) ### Tabs Tabs with panels. Arrow keys, Home and End move between tabs. ```html
``` ### Dialog Built on native : focus is trapped, Escape and the backdrop close it, and focus returns to the trigger. ```html

Edit profile

Changes are visible to your team.

``` ### Alert Dialog The same dialog, used to confirm a destructive action. ```html

Delete this project?

This removes the project and all of its data. This cannot be undone.

``` ### Sheet A dialog that slides in from the edge with the drawer curve. Add s-sheet--left for the other side. ```html

Filters

Narrow down the results.

``` ### Dropdown Menu Opens under its trigger and grows from it. Arrow keys move, Escape closes, focus returns to the button. ```html ``` ### Popover Rich content in a floating panel. Click outside or press Escape to close. ```html ``` ### Combobox Type to filter, arrows to move, Enter to pick. Listen for the s-change event to read the value. ```html
``` ### Toast Call Sabil.toast() from any script, or put data-s-toast on a button. Hover pauses the timer. ```html
``` --- # Components 66 components built on the same foundation. - [Accordion](https://ui.muttaqinsabilul.my.id/docs/components/accordion.md): A vertically stacked set of interactive headings that each reveal a section of content. - [Alert](https://ui.muttaqinsabilul.my.id/docs/components/alert.md): Displays a callout for user attention. - [Alert Dialog](https://ui.muttaqinsabilul.my.id/docs/components/alert-dialog.md): A modal dialog that interrupts the user with important content and expects a response. - [Aspect Ratio](https://ui.muttaqinsabilul.my.id/docs/components/aspect-ratio.md): Displays content within a desired ratio. - [Attachment](https://ui.muttaqinsabilul.my.id/docs/components/attachment.md): Displays a file, image or link attached to a message or form. - [Avatar](https://ui.muttaqinsabilul.my.id/docs/components/avatar.md): An image element with a fallback for representing the user. - [Badge](https://ui.muttaqinsabilul.my.id/docs/components/badge.md): Displays a badge or a component that looks like a badge. - [Breadcrumb](https://ui.muttaqinsabilul.my.id/docs/components/breadcrumb.md): Displays the path to the current resource using a hierarchy of links. - [Bubble](https://ui.muttaqinsabilul.my.id/docs/components/bubble.md): A chat bubble for conversational interfaces. - [Button](https://ui.muttaqinsabilul.my.id/docs/components/button.md): Displays a button or a component that looks like a button. - [Button Group](https://ui.muttaqinsabilul.my.id/docs/components/button-group.md): A container that groups related buttons together with consistent styling. - [Calendar](https://ui.muttaqinsabilul.my.id/docs/components/calendar.md): A date field component that allows users to enter and edit date. - [Card](https://ui.muttaqinsabilul.my.id/docs/components/card.md): Displays a card with header, content, and footer. - [Carousel](https://ui.muttaqinsabilul.my.id/docs/components/carousel.md): A carousel with motion and swipe built using Embla. - [Chart](https://ui.muttaqinsabilul.my.id/docs/components/chart.md): Beautiful charts. Built using Recharts. Copy and paste into your apps. - [Checkbox](https://ui.muttaqinsabilul.my.id/docs/components/checkbox.md): A control that allows the user to toggle between checked and not checked. - [Code Block](https://ui.muttaqinsabilul.my.id/docs/components/code-block.md): Displays a block of code with syntax highlighting and a copy button. - [Collapsible](https://ui.muttaqinsabilul.my.id/docs/components/collapsible.md): An interactive component which expands or collapses a panel. - [Combobox](https://ui.muttaqinsabilul.my.id/docs/components/combobox.md): Autocomplete input and command palette with a list of suggestions. - [Command](https://ui.muttaqinsabilul.my.id/docs/components/command.md): Fast, composable, unstyled command menu for React. - [Context Menu](https://ui.muttaqinsabilul.my.id/docs/components/context-menu.md): Displays a menu to the user, triggered by a right click. - [Data Table](https://ui.muttaqinsabilul.my.id/docs/components/data-table.md): Powerful table and datagrids built using TanStack Table. - [Date Picker](https://ui.muttaqinsabilul.my.id/docs/components/date-picker.md): A date picker component with range and presets. - [Dialog](https://ui.muttaqinsabilul.my.id/docs/components/dialog.md): A window overlaid on either the primary window or another dialog window. - [Direction](https://ui.muttaqinsabilul.my.id/docs/components/direction.md): Provides the reading direction (LTR or RTL) to every component below it. - [Drawer](https://ui.muttaqinsabilul.my.id/docs/components/drawer.md): A drawer component for React, built on Vaul. - [Dropdown Menu](https://ui.muttaqinsabilul.my.id/docs/components/dropdown-menu.md): Displays a menu to the user, such as a set of actions or functions, triggered by a button. - [Empty](https://ui.muttaqinsabilul.my.id/docs/components/empty.md): Use the Empty component to display an empty state. - [Field](https://ui.muttaqinsabilul.my.id/docs/components/field.md): Combine labels, controls, and help text to compose accessible form fields. - [Hover Card](https://ui.muttaqinsabilul.my.id/docs/components/hover-card.md): For sighted users to preview content available behind a link. - [Input](https://ui.muttaqinsabilul.my.id/docs/components/input.md): Displays a form input field or a component that looks like an input field. - [Input Group](https://ui.muttaqinsabilul.my.id/docs/components/input-group.md): Add addons, buttons, and helper content to inputs. - [Input OTP](https://ui.muttaqinsabilul.my.id/docs/components/input-otp.md): Accessible one-time password component with copy paste functionality. - [Item](https://ui.muttaqinsabilul.my.id/docs/components/item.md): A versatile component for displaying content with media, title, description and actions. - [Kbd](https://ui.muttaqinsabilul.my.id/docs/components/kbd.md): Used to display textual user input from keyboard. - [Label](https://ui.muttaqinsabilul.my.id/docs/components/label.md): Renders an accessible label associated with controls. - [Marker](https://ui.muttaqinsabilul.my.id/docs/components/marker.md): A compact status line for events in a timeline or activity feed. - [Menubar](https://ui.muttaqinsabilul.my.id/docs/components/menubar.md): A visually persistent menu common in desktop applications. - [Message](https://ui.muttaqinsabilul.my.id/docs/components/message.md): Layout for a single message in a conversation, with avatar, header and footer. - [Message Scroller](https://ui.muttaqinsabilul.my.id/docs/components/message-scroller.md): A scroll container for chat that keeps the newest message in view. - [Native Select](https://ui.muttaqinsabilul.my.id/docs/components/native-select.md): A styled native HTML select element. - [Navigation Menu](https://ui.muttaqinsabilul.my.id/docs/components/navigation-menu.md): A collection of links for navigating websites. - [Pagination](https://ui.muttaqinsabilul.my.id/docs/components/pagination.md): Pagination with page navigation, next and previous links. - [Popover](https://ui.muttaqinsabilul.my.id/docs/components/popover.md): Displays rich content in a portal, triggered by a button. - [Progress](https://ui.muttaqinsabilul.my.id/docs/components/progress.md): Displays an indicator showing the completion progress of a task. - [Questionnaire](https://ui.muttaqinsabilul.my.id/docs/components/questionnaire.md): A step-by-step set of questions with keyboard shortcuts. - [Radio Group](https://ui.muttaqinsabilul.my.id/docs/components/radio-group.md): A set of checkable buttons where no more than one can be checked at a time. - [Resizable](https://ui.muttaqinsabilul.my.id/docs/components/resizable.md): Accessible resizable panel groups and layouts with keyboard support. - [Scroll Area](https://ui.muttaqinsabilul.my.id/docs/components/scroll-area.md): Augments native scroll functionality for custom, cross-browser styling. - [Select](https://ui.muttaqinsabilul.my.id/docs/components/select.md): Displays a list of options for the user to pick from, triggered by a button. - [Separator](https://ui.muttaqinsabilul.my.id/docs/components/separator.md): Visually or semantically separates content. - [Sheet](https://ui.muttaqinsabilul.my.id/docs/components/sheet.md): Extends the Dialog component to display content that complements the main content of the screen. - [Sidebar](https://ui.muttaqinsabilul.my.id/docs/components/sidebar.md): A composable, themeable and customizable sidebar component. - [Skeleton](https://ui.muttaqinsabilul.my.id/docs/components/skeleton.md): Use to show a placeholder while content is loading. - [Slider](https://ui.muttaqinsabilul.my.id/docs/components/slider.md): An input where the user selects a value from within a given range. - [Spinner](https://ui.muttaqinsabilul.my.id/docs/components/spinner.md): An indicator that can be used to show a loading state. - [Switch](https://ui.muttaqinsabilul.my.id/docs/components/switch.md): A control that allows the user to toggle between checked and not checked. - [Table](https://ui.muttaqinsabilul.my.id/docs/components/table.md): A responsive table component. - [Tabs](https://ui.muttaqinsabilul.my.id/docs/components/tabs.md): A set of layered sections of content, known as tab panels, displayed one at a time. - [Textarea](https://ui.muttaqinsabilul.my.id/docs/components/textarea.md): Displays a form textarea or a component that looks like a textarea. - [Toast](https://ui.muttaqinsabilul.my.id/docs/components/toast.md): An opinionated toast component for React, built on Sonner. - [Toggle](https://ui.muttaqinsabilul.my.id/docs/components/toggle.md): A two-state button that can be either on or off. - [Toggle Group](https://ui.muttaqinsabilul.my.id/docs/components/toggle-group.md): A set of two-state buttons that can be toggled on or off. - [Tooltip](https://ui.muttaqinsabilul.my.id/docs/components/tooltip.md): A popup that displays information related to an element on hover or focus. - [Trace](https://ui.muttaqinsabilul.my.id/docs/components/trace.md): Shows the steps an agent or a job takes, with live status. - [Typography](https://ui.muttaqinsabilul.my.id/docs/components/typography.md): Styles for headings, paragraphs, lists and more. --- # Accordion A vertically stacked set of interactive headings that each reveal a section of content. Dependencies: cn, lucide-react, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/accordion.json ## Usage ```tsx import { Accordion, AccordionItem, AccordionTrigger, AccordionContent, } from "@/components/ui/accordion" ``` ## Example ```tsx import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion" export default function AccordionDemo() { return ( What are your shipping options? We offer standard (5-7 days), express (2-3 days), and overnight shipping. Free shipping on international orders. What is your return policy? Returns accepted within 30 days. Items must be unused and in original packaging. Refunds processed within 5-7 business days. How can I contact customer support? Reach us via email, live chat, or phone. We respond within 24 hours during business days. ) } ``` --- # Alert Displays a callout for user attention. Dependencies: class-variance-authority, cn. Source: https://ui.muttaqinsabilul.my.id/r/alert.json ## Usage ```tsx import { Alert, AlertTitle, AlertDescription, AlertAction, } from "@/components/ui/alert" ``` ## Example ```tsx import { CheckCircle2Icon, InfoIcon } from "lucide-react" import { Alert, AlertDescription, AlertTitle, } from "@/components/ui/alert" export default function AlertDemo() { return (
Payment successful Your payment of $29.99 has been processed. A receipt has been sent to your email address. New feature available We've added dark mode support. You can enable it in your account settings.
) } ``` --- # Alert Dialog A modal dialog that interrupts the user with important content and expects a response. Dependencies: cn, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/alert-dialog.json ## Usage ```tsx import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog" ``` ## Example ```tsx import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog" import { Button } from "@/components/ui/button" export default function AlertDialogDemo() { return ( Are you absolutely sure? This action cannot be undone. This will permanently delete your account from our servers. Cancel Continue ) } ``` --- # Aspect Ratio Displays content within a desired ratio. Dependencies: radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/aspect-ratio.json ## Usage ```tsx import { AspectRatio } from "@/components/ui/aspect-ratio" ``` ## Example ```tsx import Image from "next/image" import { AspectRatio } from "@/components/ui/aspect-ratio" export default function AspectRatioDemo() { return (
Photo
) } ``` --- # Attachment Displays a file, image or link attached to a message or form. Dependencies: class-variance-authority, cn, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/attachment.json ## Usage ```tsx import { Attachment, AttachmentGroup, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentAction, AttachmentTrigger, } from "@/components/ui/attachment" ``` ## Example ```tsx import { FileCodeIcon, XIcon } from "lucide-react" import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, } from "@/components/ui/attachment" import { Spinner } from "@/components/ui/spinner" const images = [ { name: "workspace.png", meta: "PNG · 820 KB", src: "https://images.unsplash.com/photo-1497366754035-f200968a6e72?w=900&auto=format&fit=crop&q=80", alt: "Workspace", }, { name: "desk-reference.jpg", meta: "JPG · 1.1 MB", src: "https://images.unsplash.com/photo-1497215728101-856f4ea42174?w=900&auto=format&fit=crop&q=80", alt: "Desk", }, { name: "office-reference.jpg", meta: "JPG · 940 KB", src: "https://images.unsplash.com/photo-1497366811353-6870744d04b2?w=900&auto=format&fit=crop&q=80", alt: "Office", }, ] export function AttachmentDemo() { return (
{images.map((image) => ( {image.alt} {image.name} {image.meta} ))} sales-dashboard.pdf Uploading · 64% message-renderer.tsx TypeScript · 12 KB
) } ``` --- # Avatar An image element with a fallback for representing the user. Dependencies: cn, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/avatar.json ## Usage ```tsx import { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, } from "@/components/ui/avatar" ``` ## Example ```tsx import { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, } from "@/components/ui/avatar" export default function AvatarDemo() { return (
CN ER CN LR ER +3
) } ``` --- # Badge Displays a badge or a component that looks like a badge. Dependencies: class-variance-authority, cn, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/badge.json ## Usage ```tsx import { Badge } from "@/components/ui/badge" ``` ## Example ```tsx import { Badge } from "@/components/ui/badge" export default function BadgeDemo() { return (
Badge Secondary Destructive Outline
) } ``` --- # Breadcrumb Displays the path to the current resource using a hierarchy of links. Dependencies: cn, lucide-react, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/breadcrumb.json ## Usage ```tsx import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from "@/components/ui/breadcrumb" ``` ## Example ```tsx import Link from "next/link" import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb" import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" export function BreadcrumbDemo() { return ( Home Documentation Themes GitHub Components Breadcrumb ) } ``` --- # Bubble A chat bubble for conversational interfaces. Dependencies: class-variance-authority, cn, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/bubble.json ## Usage ```tsx import { BubbleGroup, Bubble, BubbleContent, BubbleReactions, } from "@/components/ui/bubble" ``` ## Example ```tsx import { Bubble, BubbleContent, BubbleGroup, BubbleReactions, } from "@/components/ui/bubble" export function BubbleDemo() { return (
Hey there! what's up? Hey! Want to see chat bubbles? I can group messages, switch sides, and keep the whole thread easy to scan. 👍 Sure. Hit me with your best demo. Yes. You are reading a demo that is demoing itself. Very meta. Very on-brand. 👍 🔥 👀 +2
) } ``` --- # Button Displays a button or a component that looks like a button. Dependencies: class-variance-authority, cn, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/button.json ## Usage ```tsx import { Button } from "@/components/ui/button" ``` ## Example ```tsx import { LockIcon } from "lucide-react" import { Button } from "@/components/ui/button" export default function ButtonDemo() { return (
) } function GoogleIcon() { return ( ) } function AppleIcon() { return ( ) } function GitHubIcon() { return ( ) } ``` --- # Button Group A container that groups related buttons together with consistent styling. Dependencies: class-variance-authority, cn, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/button-group.json ## Usage ```tsx import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText } from "@/components/ui/button-group" ``` ## Example ```tsx "use client" import * as React from "react" import { ArchiveIcon, ArrowLeftIcon, CalendarPlusIcon, ClockIcon, ListFilterIcon, MailCheckIcon, MoreHorizontalIcon, TagIcon, Trash2Icon, } from "lucide-react" import { Button } from "@/components/ui/button" import { ButtonGroup } from "@/components/ui/button-group" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" export default function ButtonGroupDemo() { const [label, setLabel] = React.useState("personal") return ( Mark as Read Archive Snooze Add to Calendar Add to List Label As... Personal Work Other Trash ) } ``` --- # Calendar A date field component that allows users to enter and edit date. Dependencies: cn, lucide-react, react-day-picker. Source: https://ui.muttaqinsabilul.my.id/r/calendar.json ## Usage ```tsx import { Calendar, CalendarDayButton } from "@/components/ui/calendar" ``` ## Example ```tsx "use client" import * as React from "react" import { Calendar } from "@/components/ui/calendar" export default function CalendarDemo() { const [date, setDate] = React.useState(new Date()) return ( ) } ``` --- # Card Displays a card with header, content, and footer. Dependencies: cn. Source: https://ui.muttaqinsabilul.my.id/r/card.json ## Usage ```tsx import { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from "@/components/ui/card" ``` ## Example ```tsx import { Button } from "@/components/ui/button" import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" export default function CardDemo() { return ( Login to your account Enter your email below to login to your account
) } ``` --- # Carousel A carousel with motion and swipe built using Embla. Dependencies: cn, embla-carousel-react, lucide-react. Source: https://ui.muttaqinsabilul.my.id/r/carousel.json ## Usage ```tsx import { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, } from "@/components/ui/carousel" ``` ## Example ```tsx import * as React from "react" import { Card, CardContent } from "@/components/ui/card" import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from "@/components/ui/carousel" export default function CarouselDemo() { return ( {Array.from({ length: 5 }).map((_, index) => (
{index + 1}
))}
) } ``` --- # Chart Beautiful charts. Built using Recharts. Copy and paste into your apps. Dependencies: cn, recharts. Source: https://ui.muttaqinsabilul.my.id/r/chart.json ## Usage ```tsx import { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, } from "@/components/ui/chart" ``` ## Example ```tsx "use client" import * as React from "react" import { Bar, BarChart, CartesianGrid, XAxis } from "recharts" import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card" import { ChartContainer, ChartTooltip, ChartTooltipContent, type ChartConfig, } from "@/components/ui/chart" export const description = "An interactive bar chart" const chartData = [ { date: "2024-04-01", desktop: 222, mobile: 150 }, { date: "2024-04-02", desktop: 97, mobile: 180 }, { date: "2024-04-03", desktop: 167, mobile: 120 }, { date: "2024-04-04", desktop: 242, mobile: 260 }, { date: "2024-04-05", desktop: 373, mobile: 290 }, { date: "2024-04-06", desktop: 301, mobile: 340 }, { date: "2024-04-07", desktop: 245, mobile: 180 }, { date: "2024-04-08", desktop: 409, mobile: 320 }, { date: "2024-04-09", desktop: 59, mobile: 110 }, { date: "2024-04-10", desktop: 261, mobile: 190 }, { date: "2024-04-11", desktop: 327, mobile: 350 }, { date: "2024-04-12", desktop: 292, mobile: 210 }, { date: "2024-04-13", desktop: 342, mobile: 380 }, { date: "2024-04-14", desktop: 137, mobile: 220 }, { date: "2024-04-15", desktop: 120, mobile: 170 }, { date: "2024-04-16", desktop: 138, mobile: 190 }, { date: "2024-04-17", desktop: 446, mobile: 360 }, { date: "2024-04-18", desktop: 364, mobile: 410 }, { date: "2024-04-19", desktop: 243, mobile: 180 }, { date: "2024-04-20", desktop: 89, mobile: 150 }, { date: "2024-04-21", desktop: 137, mobile: 200 }, { date: "2024-04-22", desktop: 224, mobile: 170 }, { date: "2024-04-23", desktop: 138, mobile: 230 }, { date: "2024-04-24", desktop: 387, mobile: 290 }, { date: "2024-04-25", desktop: 215, mobile: 250 }, { date: "2024-04-26", desktop: 75, mobile: 130 }, { date: "2024-04-27", desktop: 383, mobile: 420 }, { date: "2024-04-28", desktop: 122, mobile: 180 }, { date: "2024-04-29", desktop: 315, mobile: 240 }, { date: "2024-04-30", desktop: 454, mobile: 380 }, ] const chartConfig = { views: { label: "Page Views", }, desktop: { label: "Desktop", color: "var(--chart-2)", }, mobile: { label: "Mobile", color: "var(--chart-1)", }, } satisfies ChartConfig export function ChartDemo() { const [activeChart, setActiveChart] = React.useState("desktop") const total = React.useMemo( () => ({ desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0), mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0), }), [] ) return (
Bar Chart - Interactive Showing total visitors for the last 3 months
{["desktop", "mobile"].map((key) => { const chart = key as keyof typeof chartConfig return ( ) })}
{ const date = new Date(value) return date.toLocaleDateString("en-US", { month: "short", day: "numeric", }) }} /> { return new Date(value).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric", }) }} /> } />
) } ``` --- # Checkbox A control that allows the user to toggle between checked and not checked. Dependencies: cn, lucide-react, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/checkbox.json ## Usage ```tsx import { Checkbox } from "@/components/ui/checkbox" ``` ## Example ```tsx "use client" import { Checkbox } from "@/components/ui/checkbox" import { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldTitle, } from "@/components/ui/field" import { Label } from "@/components/ui/label" export default function CheckboxDemo() { return ( Accept terms and conditions By clicking this checkbox, you agree to the terms. Enable notifications Enable notifications You can enable or disable notifications at any time. ) } ``` --- # Code Block Displays a block of code with syntax highlighting and a copy button. Dependencies: class-variance-authority, cn, lucide-react. Source: https://ui.muttaqinsabilul.my.id/r/code-block.json ## Usage ```tsx import { CodeBlock, CodeBlockHeader, CodeBlockTitle, CodeBlockActions, CodeBlockCopyButton, CodeBlockContent, CodeBlockLine, CodeBlockFooter, } from "@/components/ui/code-block" ``` ## Example ```tsx "use client" import * as React from "react" import { DownloadIcon, FileCodeIcon, WrapTextIcon } from "lucide-react" import { useHighlightedCode } from "@/hooks/use-highlighted-code" import { Button } from "@/components/ui/button" import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockHeader, CodeBlockLine, CodeBlockTitle, } from "@/components/ui/code-block" const code = `import { streamText } from "ai" export async function POST(request: Request) { const { messages } = await request.json() const result = streamText({ model: "anthropic/claude-sonnet-4.5", system: "You are a helpful assistant. Answer in one short paragraph.", messages, }) return result.toUIMessageStreamResponse() }` function download(value: string, filename: string) { const url = URL.createObjectURL(new Blob([value], { type: "text/plain" })) const link = document.createElement("a") link.href = url link.download = filename link.click() URL.revokeObjectURL(url) } export function CodeBlockDemo() { const [wrap, setWrap] = React.useState(false) const lines = useHighlightedCode(code, "ts") return (
app/api/chat/route.ts {lines.map((line, index) => ( = 5 && index <= 9 ? "highlighted" : "default"} > {line} ))}
) } ``` --- # Collapsible An interactive component which expands or collapses a panel. Dependencies: radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/collapsible.json ## Usage ```tsx import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@/components/ui/collapsible" ``` ## Example ```tsx "use client" import * as React from "react" import { ChevronsUpDown } from "lucide-react" import { Button } from "@/components/ui/button" import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible" export default function CollapsibleDemo() { const [isOpen, setIsOpen] = React.useState(false) return (

Order #4189

Status Shipped

Shipping address

100 Market St, San Francisco

Items

2x Studio Headphones

) } ``` --- # Combobox Autocomplete input and command palette with a list of suggestions. Dependencies: @base-ui/react, cn, lucide-react. Source: https://ui.muttaqinsabilul.my.id/r/combobox.json ## Usage ```tsx import { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, } from "@/components/ui/combobox" ``` ## Example ```tsx "use client" import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@/components/ui/combobox" const frameworks = [ "Next.js", "SvelteKit", "Nuxt.js", "Remix", "Astro", ] as const export default function ComboboxBasic() { return ( No items found. {(item) => ( {item} )} ) } ``` --- # Command Fast, composable, unstyled command menu for React. Dependencies: cmdk, cn, lucide-react. Source: https://ui.muttaqinsabilul.my.id/r/command.json ## Usage ```tsx import { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, } from "@/components/ui/command" ``` ## Example ```tsx import { Calculator, Calendar, CreditCard, Settings, Smile, User, } from "lucide-react" import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "@/components/ui/command" export function CommandDemo() { return ( No results found. Calendar Search Emoji Calculator Profile ⌘P Billing ⌘B Settings ⌘S ) } ``` --- # Context Menu Displays a menu to the user, triggered by a right click. Dependencies: cn, lucide-react, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/context-menu.json ## Usage ```tsx import { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, } from "@/components/ui/context-menu" ``` ## Example ```tsx import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "@/components/ui/context-menu" export function ContextMenuDemo() { return ( Right click here Long press here Back ⌘[ Forward ⌘] Reload ⌘R More Tools Save Page... Create Shortcut... Name Window... Developer Tools Delete Show Bookmarks Show Full URLs People Pedro Duarte Colm Tuite ) } ``` --- # Data Table Powerful table and datagrids built using TanStack Table. Dependencies: cn. Source: https://ui.muttaqinsabilul.my.id/r/table.json ## Usage ```tsx import { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, } from "@/components/ui/table" ``` ## Example ```tsx "use client" import * as React from "react" import { columnFilteringFeature, columnVisibilityFeature, createColumnHelper, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, filterFn_includesString, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_text, tableFeatures, useTable, type ColumnFiltersState, type ColumnVisibilityState, type SortingState, } from "@tanstack/react-table" import { ArrowUpDown, ChevronDown, MoreHorizontal } from "lucide-react" import { Button } from "@/components/ui/button" import { Checkbox } from "@/components/ui/checkbox" import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { Input } from "@/components/ui/input" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table" // New in v9: declare the features this table uses — anything you don't // register is tree-shaken out of the bundle. const features = tableFeatures({ columnFilteringFeature, columnVisibilityFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, filteredRowModel: createFilteredRowModel(), paginatedRowModel: createPaginatedRowModel(), sortedRowModel: createSortedRowModel(), filterFns: { includesString: filterFn_includesString }, sortFns: { alphanumeric: sortFn_alphanumeric, text: sortFn_text }, }) const columnHelper = createColumnHelper() const data: Payment[] = [ { id: "m5gr84i9", amount: 316, status: "success", email: "ken99@example.com", }, { id: "3u1reuv4", amount: 242, status: "success", email: "Abe45@example.com", }, { id: "derv1ws0", amount: 837, status: "processing", email: "Monserrat44@example.com", }, { id: "5kma53ae", amount: 874, status: "success", email: "Silas22@example.com", }, { id: "bhqecj4p", amount: 721, status: "failed", email: "carmella@example.com", }, ] export type Payment = { id: string amount: number status: "pending" | "processing" | "success" | "failed" email: string } export const columns = columnHelper.columns([ columnHelper.display({ id: "select", header: ({ table }) => ( table.toggleAllPageRowsSelected(!!value)} aria-label="Select all" /> ), cell: ({ row }) => ( row.toggleSelected(!!value)} aria-label="Select row" /> ), enableSorting: false, enableHiding: false, }), columnHelper.accessor("status", { header: "Status", cell: ({ row }) => (
{row.getValue("status")}
), }), columnHelper.accessor("email", { header: ({ column }) => { return ( ) }, cell: ({ row }) =>
{row.getValue("email")}
, }), columnHelper.accessor("amount", { header: () =>
Amount
, cell: ({ row }) => { const amount = parseFloat(row.getValue("amount")) // Format the amount as a dollar amount. const formatted = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", }).format(amount) return
{formatted}
}, }), columnHelper.display({ id: "actions", enableHiding: false, cell: ({ row }) => { const payment = row.original return ( Actions navigator.clipboard.writeText(payment.id)} > Copy payment ID View customer View payment details ) }, }), ]) export function DataTableDemo() { const [sorting, setSorting] = React.useState([]) const [columnFilters, setColumnFilters] = React.useState( [] ) const [columnVisibility, setColumnVisibility] = React.useState({}) const [rowSelection, setRowSelection] = React.useState({}) const table = useTable({ features, data, columns, onSortingChange: setSorting, onColumnFiltersChange: setColumnFilters, onColumnVisibilityChange: setColumnVisibility, onRowSelectionChange: setRowSelection, state: { sorting, columnFilters, columnVisibility, rowSelection, }, }) return (
table.getColumn("email")?.setFilterValue(event.target.value) } className="max-w-sm" /> {table .getAllColumns() .filter((column) => column.getCanHide()) .map((column) => { return ( column.toggleVisibility(!!value) } > {column.id} ) })}
{table.getHeaderGroups().map((headerGroup) => ( {headerGroup.headers.map((header) => { return ( {header.isPlaceholder ? null : ( )} ) })} ))} {table.getRowModel().rows?.length ? ( table.getRowModel().rows.map((row) => ( {row.getVisibleCells().map((cell) => ( ))} )) ) : ( No results. )}
{table.getFilteredSelectedRowModel().rows.length} of{" "} {table.getFilteredRowModel().rows.length} row(s) selected.
) } ``` --- # Date Picker A date picker component with range and presets. Dependencies: cn, lucide-react, react-day-picker, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/calendar.json ## Usage ```tsx import { Calendar, CalendarDayButton } from "@/components/ui/calendar" ``` ## Example ```tsx "use client" import * as React from "react" import { format } from "date-fns" import { ChevronDownIcon } from "lucide-react" import { Button } from "@/components/ui/button" import { Calendar } from "@/components/ui/calendar" import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover" export function DatePickerDemo() { const [date, setDate] = React.useState() return ( ) } ``` --- # Dialog A window overlaid on either the primary window or another dialog window. Dependencies: cn, lucide-react, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/dialog.json ## Usage ```tsx import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "@/components/ui/dialog" ``` ## Example ```tsx import { Button } from "@/components/ui/button" import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/components/ui/dialog" import { Field, FieldGroup } from "@/components/ui/field" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" export function DialogDemo() { return (
Edit profile Make changes to your profile here. Click save when you're done.
) } ``` --- # Direction Provides the reading direction (LTR or RTL) to every component below it. Dependencies: radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/direction.json ## Usage ```tsx import { DirectionProvider } from "@/components/ui/direction" ``` ## Example ```tsx "use client" import * as React from "react" import { DirectionProvider } from "@/components/ui/direction" import { Slider } from "@/components/ui/slider" import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs" import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" export default function DirectionDemo() { const [dir, setDir] = React.useState<"ltr" | "rtl">("rtl") return (
v && setDir(v as "ltr" | "rtl")} className="self-center" > LTR RTL
{dir === "rtl" ? "الأول" : "First"} {dir === "rtl" ? "الثاني" : "Second"} {dir === "rtl" ? "الثالث" : "Third"}
) } ``` --- # Drawer A drawer component for React, built on Vaul. Dependencies: cn, vaul. Source: https://ui.muttaqinsabilul.my.id/r/drawer.json ## Usage ```tsx import { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, } from "@/components/ui/drawer" ``` ## Example ```tsx "use client" import * as React from "react" import { Minus, Plus } from "lucide-react" import { Bar, BarChart, ResponsiveContainer } from "recharts" import { Button } from "@/components/ui/button" import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from "@/components/ui/drawer" const data = [ { goal: 400, }, { goal: 300, }, { goal: 200, }, { goal: 300, }, { goal: 200, }, { goal: 278, }, { goal: 189, }, { goal: 239, }, { goal: 300, }, { goal: 200, }, { goal: 278, }, { goal: 189, }, { goal: 349, }, ] export function DrawerDemo() { const [goal, setGoal] = React.useState(350) function onClick(adjustment: number) { setGoal(Math.max(200, Math.min(400, goal + adjustment))) } return (
Move Goal Set your daily activity goal.
{goal}
Calories/day
) } ``` --- # Dropdown Menu Displays a menu to the user, such as a set of actions or functions, triggered by a button. Dependencies: cn, lucide-react, radix-ui. Source: https://ui.muttaqinsabilul.my.id/r/dropdown-menu.json ## Usage ```tsx import { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from "@/components/ui/dropdown-menu" ``` ## Example ```tsx import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" export function DropdownMenuDemo() { return ( My Account Profile ⇧⌘P Billing ⌘B Settings ⌘S Team Invite users Email Message More... New Team ⌘+T GitHub Support API Log out ⇧⌘Q ) } ``` --- # Empty Use the Empty component to display an empty state. Dependencies: class-variance-authority, cn. Source: https://ui.muttaqinsabilul.my.id/r/empty.json ## Usage ```tsx import { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, } from "@/components/ui/empty" ``` ## Example ```tsx import { IconFolderCode } from "@tabler/icons-react" import { ArrowUpRightIcon } from "lucide-react" import { Button } from "@/components/ui/button" import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, } from "@/components/ui/empty" export default function EmptyDemo() { return ( No Projects Yet You haven't created any projects yet. Get started by creating your first project. ) } ``` --- # Field Combine labels, controls, and help text to compose accessible form fields. Dependencies: class-variance-authority, cn. Source: https://ui.muttaqinsabilul.my.id/r/field.json ## Usage ```tsx import { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, } from "@/components/ui/field" ``` ## Example ```tsx import { Button } from "@/components/ui/button" import { Checkbox } from "@/components/ui/checkbox" import { Field, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, } from "@/components/ui/field" import { Input } from "@/components/ui/input" import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select" import { Textarea } from "@/components/ui/textarea" export default function FieldDemo() { return (
Payment Method All transactions are secure and encrypted Name on Card Card Number Enter your 16-digit card number
Month Year CVV
Billing Address The billing address associated with your payment method Same as shipping address
Comments