Adoption
Bring @dev-dga into an existing app.
Add the styles, wrap the root in DgaProvider, and replace screens one at a time. These steps work for a Laravel and Inertia app, a Next.js app, or any React 19 project.
Set up the stylesheet
Import @dev-dga/css once. With Tailwind v4, declare the cascade layers first so the library sits between Tailwind’s base and its utilities, then add the token bridge for bg-primary, text-ink, and the rest of the DGA scale.
Keep your own @source lines. The library ships its own reset, so Tailwind preflight is optional. Styling with Tailwind
Wrap the app in DgaProvider
DgaProvider sets the direction, the locale, the DGA font, and light or dark mode through data-theme. Portaled overlays such as Modal, Select, and DatePicker render inside it, so they inherit the theme and direction.
Pick the components
Each need maps to one or more @dev-dga components. Labels, helper text, and errors are props on the field itself, so you don’t wire ids by hand.
| You need | @dev-dga components | Notes |
|---|---|---|
| Actions and links | Button, Link | asChild renders a router link as the button itself. |
| Text fields | TextInput, Textarea, NumberInput, SearchBox | label, helperText, error, and errorMessage are props. |
| Choices | Select, Dropdown, Checkbox, RadioGroup, Switch | Dropdown adds search and multi-select. |
| Dates | DatePicker, DateRangePicker | Gregorian and Hijri; name submits YYYY-MM-DD. |
| Dialogs and panels | Modal, Drawer, SlideoutMenu | SlideoutMenu is the mobile navigation panel. |
| Navigation | Header, Sidebar, DropdownMenu, Breadcrumb, Tabs | SidebarMenuButton takes asChild for router links. |
| Feedback | NotificationToast + toast(), InlineAlert, Tag, StatusTag | Mount NotificationToast once, call toast() anywhere. |
| Data | Table, Pagination, Filtration, EmptyState, Skeleton | See the server-driven table recipe in Storybook. |
| Segmented views | ContentSwitcher, Toggle | They switch views and don’t submit; in a form, use RadioGroup or Checkbox. |
Router links
Components that render a link or a menu button take asChild, so an Inertia or Next.js <Link> becomes the element itself: one focusable element, client-side navigation, and the active styles from isActive.
Forms
Every form control submits through FormData when you give it a name, so plain forms, Inertia <Form>, React Router actions, and server actions work without extra wiring.
Coming from another Tailwind UI kit
Replace the kit in one step rather than running both. Kits such as shadcn/ui, which the Laravel and Next.js starter kits ship, define Tailwind theme names like --color-primary and --color-border in an @theme block. The @dev-dga token bridge defines the same names, so whichever file loads last recolors the other.
- Delete the kit’s @theme block and its :root and .dark color variables.
- Remove the kit’s animation plugin and its dark-mode class variant; DgaProvider mode controls dark mode.
- Replace the kit’s components screen by screen, then delete its component folder.
After the swap, look for pagination, KPI cards, empty states, and steppers that your app built before the move. The swap replaces the kit’s primitives, while the parts your app composed from them stay behind. Each has a replacement:
Before you ship
- The stylesheet declares the layers before importing @dev-dga/css.
- DgaProvider wraps the root, and dark mode switches through its mode prop.
- Each form submits the payload your server expects: see the Forms guide.
- Every page is checked in LTR and RTL, light and dark.