### Install Prerequisites Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/theme/theme-unify.mdx Install the necessary reablocks and Tailwind CSS dependencies. ```bash npm install reablocks npm install -D tailwindcss @tailwindcss/postcss postcss postcss-nested postcss-preset-env ``` -------------------------------- ### Initialize Reablocks via CLI Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Run this command in the project root to start the interactive setup process. ```sh npx reablocks-cli@latest init ``` -------------------------------- ### Install dependencies Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Run this command within the project directory to install all required packages. ```bash npm install ``` -------------------------------- ### Install Reablocks skills via npx Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/skills.mdx The recommended quick installation method to fetch and install the latest skills automatically. ```bash npx skills add reaviz/skills ``` -------------------------------- ### Install tw-colors Plugin Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/migration.mdx Command to install the required dependency for managing multiple themes. ```shell npm i -D tw-colors ``` -------------------------------- ### Start Storybook Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Launches the local development server, typically accessible at http://localhost:9009. ```bash npm start ``` -------------------------------- ### Install Tanstack Table Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/recipes/table.mdx Install the required dependency for the data table model. ```shell npm install @tanstack/react-table ``` -------------------------------- ### Basic Menu Example Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layers/menu.mdx Displays a simple list of menu items. ```tsx ``` -------------------------------- ### Render Input Value Initialization Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/form/input.mdx Displays examples for setting placeholders and default values. ```tsx ``` ```tsx ``` -------------------------------- ### Chip Customization Examples Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/chip.mdx Examples showing how to customize Chip colors, sizes, and icon adornments. ```tsx ``` ```tsx ``` ```tsx ``` -------------------------------- ### Quick Start with cn Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/utils/cn.mdx Demonstrates basic usage for merging classes and handling conditional logic. ```tsx import { cn } from 'reablocks'; cn('px-4 py-2', 'px-6'); // → 'py-2 px-6' (px-4 is dropped because px-6 wins) cn('text-sm', isActive && 'font-bold text-primary', { 'opacity-50': disabled }); // → 'text-sm font-bold text-primary' (when isActive=true, disabled=false) ``` -------------------------------- ### Calendar Initialization and Display Options Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/form/calendar.mdx Examples for setting default values, labels, and multi-view layouts. ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` -------------------------------- ### Install Tailwind CSS Variables Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/migration.mdx Install the required dependency for Tailwind CSS variable support. ```shell npm install -D @mertasan/tailwindcss-variables ``` -------------------------------- ### Quick Start Field implementation Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layout/field.mdx Basic usage of the Field component with a label and hint. ```tsx import { Field, Input } from 'reablocks'; export default function App() { return ( ); } ``` -------------------------------- ### Quick Start Skeleton Implementation Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/skeleton.mdx Basic implementation of the Skeleton component with animation enabled. ```tsx import { Skeleton } from 'reablocks'; export default function App() { return (
); } ``` -------------------------------- ### Install Zod and Resolvers Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/recipes/forms.mdx Install the necessary dependencies to enable Zod validation with react-hook-form. ```shell npm install zod @hookform/resolvers ``` -------------------------------- ### Basic Tooltip Example Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layers/tooltip.mdx Displays a simple tooltip implementation. ```tsx ``` -------------------------------- ### Quick Start NavigationBar Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layout/navigation.mdx Basic implementation of a navigation bar with multiple buttons. ```tsx import { NavigationBar, NavigationButton } from 'reablocks'; export default function App() { return ( Home Tickets ); } ``` -------------------------------- ### Quick Start Button Usage Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/button.mdx Basic implementation of the Button component by importing it from the reablocks library. ```tsx import { Button } from 'reablocks'; export default function App() { return } ``` -------------------------------- ### Global Overlay Story Examples Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/utils/overlay.mdx Examples of using the GlobalOverlay component for interactive elements like dialogs. ```tsx ``` ```tsx ``` -------------------------------- ### Quick Start Kbd Component Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/kbd.mdx Basic implementation of the Kbd component using the keycode prop. ```tsx import { Kbd } from 'reablocks'; export default function App() { return } ``` -------------------------------- ### Install Reablocks package Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Add the Reablocks dependency to your project. ```sh npm install reablocks --save ``` -------------------------------- ### Install Tailwind CSS dependencies Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Install the required Tailwind CSS packages for your project. ```sh npm install tailwindcss @tailwindcss/cli ``` -------------------------------- ### Verify installation with Claude Code Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/skills.mdx Ask Claude Code about a component to verify that the skill files have been loaded correctly. ```text > How do I use the reablocks Select component? ``` -------------------------------- ### Connected Overlay Story Examples Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/utils/overlay.mdx Examples of using the ConnectedOverlay component for menus, tooltips, and other anchor-relative elements. ```tsx ``` ```tsx ``` ```tsx ``` -------------------------------- ### Quick Start IconButton Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/icon-button.mdx Basic implementation of the IconButton component. ```tsx import { IconButton } from 'reablocks'; export default function App() { return © } ``` -------------------------------- ### Quick Start Chip Implementation Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/chip.mdx Basic usage of the Chip component imported from reablocks. ```tsx import { Chip } from 'reablocks'; export default function App() { return Active } ``` -------------------------------- ### Quick Start Badge Implementation Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/badge.mdx Basic usage of the Badge component by importing it from reablocks and providing a content prop. ```tsx import { Badge } from 'reablocks'; export default function App() { return } ``` -------------------------------- ### Quick Start Typography Usage Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/typography/typography.mdx Import components from reablocks to render semantic text elements. ```tsx import { H1, P, Muted } from 'reablocks'; export default function App() { return ( <>

Welcome

Build beautiful interfaces with reablocks.

Last updated today. ); } ``` -------------------------------- ### Prompting Agents with DESIGN.md Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/advanced/design-md.mdx Example prompt for requesting UI components while instructing the agent to adhere to the design system. ```text > Using the design system in DESIGN.md, build a settings card with a text input, a toggle row, and primary/secondary action buttons. ``` -------------------------------- ### Quick Start HighlightedText Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/data/highlighted-text.mdx Import the component and provide the text as children along with the search keyword. ```tsx import { HighlightedText } from 'reablocks'; export default function App() { return reablocks; } ``` -------------------------------- ### Custom Animation Tooltip Example Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layers/tooltip.mdx Demonstrates how to apply custom animations using the animation and animationViewChange props. ```tsx ``` -------------------------------- ### Quick Start DotsLoader Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/loader.mdx Basic implementation of the DotsLoader component imported from the reablocks library. ```tsx import { DotsLoader } from 'reablocks'; export default function App() { return } ``` -------------------------------- ### Quick Start AvatarGroup Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/avatar-group.mdx Basic implementation showing how to import and nest Avatar components within an AvatarGroup. ```tsx import { AvatarGroup, Avatar } from 'reablocks'; export default function App() { return ( ) } ``` -------------------------------- ### Install Reablocks skills at user level Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/skills.mdx Make skills available across all personal projects by symlinking them into the global ~/.claude/skills/ directory. ```bash mkdir -p ~/.claude/skills # Symlink the library ln -s /path/to/reaviz/skills/reablocks ~/.claude/skills/reablocks ``` -------------------------------- ### Basic Dialog Story Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layers/dialog.mdx Renders a simple dialog example from the storybook. ```tsx ``` -------------------------------- ### MFA Authenticator Story Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/blocks/authentication/mfa.mdx Renders the MFA authenticator setup component. ```tsx ``` -------------------------------- ### Quick Start with useInfinityList Hook Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/data/infinity-list.mdx Initializes the Infinity List functionality by providing an array of items to the useInfinityList hook. ```typescript import { useMemo } from 'react'; import { useInfinityList } from 'reablocks'; export default function App() { const items = useMemo(() => [...Array(30).keys()], []); const { data, hasMore, showNext } = useInfinityList({ items }); return (
{data.map(i => (
Item {i}
))} {hasMore && }
); } ``` -------------------------------- ### Quick Start Avatar Implementation Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/avatar.mdx Basic usage of the Avatar component by importing it from reablocks and providing a name prop. ```tsx import { Avatar } from 'reablocks'; export default function App() { return } ``` -------------------------------- ### Basic Textarea Usage Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/form/textarea.mdx A minimal setup for a standard multiline text input field. ```tsx ``` -------------------------------- ### Quick Start Duration Component Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/data/duration.mdx Basic implementation of the Duration component using a millisecond value. ```tsx import { Duration } from 'reablocks'; export default function App() { return ( ); } ``` -------------------------------- ### Install Reablocks skills at project level Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/skills.mdx Use this method to share skills across a team by committing them to version control within the project's .claude/skills/ directory. ```bash # From your project root mkdir -p .claude/skills # Symlink the reablocks skill tree ln -s /path/to/reaviz/skills/reablocks .claude/skills/reablocks ``` -------------------------------- ### Quick Start Sort Component Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/data/sort.mdx Basic implementation requiring the direction state and an onSort callback function. ```typescript import { useState } from 'react'; import { Sort } from 'reablocks'; export default function App() { const [dir, setDir] = useState('asc'); return Age ; } ``` -------------------------------- ### Define Button Theme Sizes Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/theme/theme-unify.mdx Example of referencing detail tier variables within a component theme definition. ```ts // excerpt from ButtonTheme.ts sizes: { small: 'h-(--buttons-details-height-core-icon-sm) text-xs px-(--buttons-details-horizontal-padding-sm)', medium: 'h-(--buttons-details-height-core-icon-md) text-sm px-(--buttons-details-horizontal-padding-md)', large: 'h-(--buttons-details-height-core-icon-lg) text-base px-(--buttons-details-horizontal-padding-lg)', }, ``` -------------------------------- ### Quick Start DateFormat Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/data/date-format.mdx Basic implementation of the DateFormat component using a date string and a specific format pattern. ```tsx import { DateFormat } from 'reablocks'; export default function App() { return ( ); } ``` -------------------------------- ### Quick Start DataSize Component Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/data/data-size.mdx Basic implementation of the DataSize component by passing a byte value to the value prop. ```tsx import { DataSize } from 'reablocks'; export default function App() { return ( ); } ``` -------------------------------- ### Textarea Value Initialization Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/form/textarea.mdx Set default values or placeholder text to guide user input. ```tsx ``` ```tsx ``` -------------------------------- ### Dialog with Footer and Custom Header Story Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layers/dialog.mdx Renders a dialog example featuring a footer and custom header. ```tsx ``` -------------------------------- ### Skeleton Storybook Renderers Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/skeleton.mdx Various storybook examples demonstrating different states and configurations of the Skeleton component. ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` -------------------------------- ### Full Table Implementation with Sorting and Pagination Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/recipes/table.mdx A complete example integrating TanStack Table with reablocks Pager and Sort components. ```tsx import { useState } from 'react'; import { createColumnHelper, flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, type SortingState } from '@tanstack/react-table'; import { Pager, Sort } from 'reablocks'; type User = { id: string; name: string; email: string; age: number }; const columnHelper = createColumnHelper(); const columns = [ columnHelper.accessor('name', { header: 'Name' }), columnHelper.accessor('email', { header: 'Email' }), columnHelper.accessor('age', { header: 'Age' }) ]; export const UserTable = ({ data }: { data: User[] }) => { const [sorting, setSorting] = useState([]); const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 10 }); const table = useReactTable({ data, columns, state: { sorting, pagination }, onSortingChange: setSorting, onPaginationChange: setPagination, getCoreRowModel: getCoreRowModel(), getSortedRowModel: getSortedRowModel(), getPaginationRowModel: getPaginationRowModel() }); return (
{table.getHeaderGroups().map(group => ( {group.headers.map(header => { const sorted = header.column.getIsSorted(); const canSort = header.column.getCanSort(); const label = flexRender( header.column.columnDef.header, header.getContext() ); return ( ); })} ))} {table.getRowModel().rows.map(row => ( {row.getVisibleCells().map(cell => ( ))} ))}
{canSort ? ( header.column.toggleSorting()} > {label} ) : ( label )}
{flexRender(cell.column.columnDef.cell, cell.getContext())}
table.setPageIndex(pageIndex)} displayMode="all" />
); }; ``` -------------------------------- ### Configure CSS entry point Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/theme/theme-unify.mdx The index.css file serves as the entry point. Import order is critical: light and dark themes must precede root variables, and tw.css must be imported last. ```css @import "./common.css"; @import "./light.css"; @import "./dark.css"; @import "./root.css"; @import "./tw.css"; ``` -------------------------------- ### Implement Input Adornments Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/form/input.mdx Adds icons or text at the start or end of the input field using the start and end props. ```tsx } placeholder="Search..." /> USD} type="number" /> ``` ```tsx ``` -------------------------------- ### Initialize ThemeProvider Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Wrap the application with the ThemeProvider component to provide theme tokens to all components. ```tsx import { ThemeProvider, theme } from 'reablocks'; // NOTE: You can extend 'theme' with your own custom theme tokens. export const App = () => ( ); ``` -------------------------------- ### Disabled Tooltip Example Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layers/tooltip.mdx Displays a tooltip in a disabled state. ```tsx ``` -------------------------------- ### Clone the repository Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Use this command to download the project source code to your local machine. ```bash git clone git@github.com:reaviz/reablocks.git ``` -------------------------------- ### Import prebuilt Reablocks styles Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/setup.mdx Include this in your app entry file if you are using the default theme without customization. ```ts import "reablocks/index.css"; ``` -------------------------------- ### Complete .storybook/preview.jsx configuration Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/storybook.mdx The full configuration file combining imports, decorators, and parameters for Reablocks integration. ```jsx import { DocsContainer } from '@storybook/addon-docs'; import { ThemeProvider } from 'reablocks'; import { theme } from '[INSERT_PATH_TO_YOUR_THEME]'; export const decorators = [ Story => ( ) ]; export const parameters = { layout: 'centered', docs: { container: ({ context, children }) => ( {children} ) }, controls: { hideNoControlsWarning: true } }; ``` -------------------------------- ### Configuring global Storybook parameters Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/storybook.mdx Set global layout and documentation container settings, including wrapping the DocsContainer with the ThemeProvider. ```jsx export const parameters = { layout: 'centered', docs: { container: ({ context, children }) => ( {children} ) }, controls: { hideNoControlsWarning: true } }; ``` -------------------------------- ### Plugin Import Comparison Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/migration.mdx Comparison between incorrect and correct plugin registration methods for Storybook compatibility. ```js { plugins: [ require('@mertasan/tailwindcss-variables') ] } ``` ```js import tailwindcssVariables from '@mertasan/tailwindcss-variables'; { plugins: [ tailwindcssVariables ] } ``` -------------------------------- ### Custom Animation Dialog Story Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/layers/dialog.mdx Renders a dialog example demonstrating custom animation props. ```tsx ``` -------------------------------- ### Configure ThemeProvider at App Root Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/theme/theme-unify.mdx Wrap the application with the ThemeProvider and import the theme and CSS layers. ```tsx // src/index.tsx import { ThemeProvider } from 'reablocks'; import { theme } from 'shared/utils/Theme'; import './assets/styles/index.css'; // pulls in all CSS layers ``` -------------------------------- ### Add Icons to Buttons Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/elements/button.mdx Usage of start and end props to include icons within a button. ```tsx ``` -------------------------------- ### Define primitive and component tokens Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/theme/theme-unify.mdx The root.css file contains raw palette values, spacing, sizing, corner radius, and per-component detail tokens. ```css :root, :host { /* Colors */ --color-blue-hyperstream-500: #3476ff; --color-blue-hyperstream-600: #105eff; /* …more brand scales… */ /* Spacing */ --spacing-padding-base: 16px; /* Corner radius */ --corner-radius-primary: 6px; /* Per-component detail — the Unify differentiator */ --buttons-details-height-core-icon-lg: var(--sizing-size-tokens-base); --inputs-details-corner-radius-primary: var(--corner-radius-primary); --tabs-details-stroke-width-underline-lg: 2px; /* …more per-component detail tokens */ } ``` -------------------------------- ### Run Tailwind migration command Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/getting-started/migration.mdx Execute the official Tailwind CSS upgrade tool to migrate class names. ```shell npx @tailwindcss/upgrade ``` -------------------------------- ### Render Table Header Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/recipes/table.mdx Example of mapping through header groups to render the sortable headers in a table structure. ```tsx {table.getHeaderGroups().map(group => ( {group.headers.map(header => ( {flexRender(header.column.columnDef.header, header.getContext())} ))} ))} ``` -------------------------------- ### Render Select with Adornments Source: https://github.com/reaviz/reablocks-website/blob/master/src/content/docs/components/form/select.mdx Use the start and end props to render custom content before or after the input field. ```tsx