Skip to content
  • InstallationGuideCLI, shadcn, npm, React and Next.js
  • ThemingGuideThe theme contract, every token, writing a theme
  • ButtonActions & displayActions. Default, primary, ghost and danger, in three sizes, plus a square icon button.
  • BadgeActions & displayShort status labels and tags, in status colours or the theme’s six palette colours.
  • AvatarActions & displayA photo or initials in a palette colour, in three sizes, and a stacked group.
  • CardActions & displayThe raised surface for grouped content, with header, body and footer slots and six palette tints.
  • SurfaceActions & displayThe three materials every theme defines: raised, inset and overlay. Build your own components on them.
  • InputFormsText fields and textareas with a visible label, hint and invalid state.
  • SelectFormsA styled native <select>: keyboard, mobile pickers and screen readers work for free.
  • Checkbox and radioFormsNative checkboxes and radios, restyled, including the indeterminate state and radio groups.
  • SwitchFormsAn on/off setting that applies at once: a checkbox with role="switch".
  • SliderFormsA native range input whose filled track follows the thumb.
  • Dialog and drawerOverlaysModal <dialog>: the browser traps focus, handles Esc and returns focus to the trigger. Drawers slide from an edge.
  • Popover and menuOverlaysNative popover API (light dismiss, Esc, top layer), placed next to its trigger. A menu is a popover with role="menu".
  • TooltipOverlaysA CSS-only label on hover and keyboard focus. Esc hides it.
  • ToastFeedbackNotifications in one polite live region; errors use role="alert". They pause while hovered or focused.
  • AlertFeedbackInline messages in four tones.
  • ProgressFeedbackA native <progress>; leave out value for an indeterminate bar.
  • SkeletonFeedbackPlaceholders while content loads.
  • TabsNavigation & dataWAI-ARIA tabs with automatic activation and roving focus.
  • AccordionNavigation & dataNative <details>: works without JavaScript. The same name keeps one item open.
  • TableNavigation & dataData tables that scroll sideways on small screens; compact density tightens rows.
  • PaginationNavigation & dataPage links in a labelled nav with the current page marked.

Overlays

Dialog and drawer

Modal <dialog>: the browser traps focus, handles Esc and returns focus to the trigger. Drawers slide from an edge.

Dialog

Delete project?

This removes all 24 files. You can’t undo it.

html
<button class="og-button og-button--danger" data-og-open="dialog">Delete project</button>
<dialog class="og-dialog" id="dialog" aria-labelledby="dialog-t">
  <header class="og-dialog__header">
    <div>
      <h2 class="og-dialog__title" id="dialog-t">Delete project?</h2>
      <p class="og-dialog__description">This removes all 24 files. You can’t undo it.</p>
    </div>
    <button class="og-dialog__close" data-og-close aria-label="Close"></button>
  </header>
  <footer class="og-dialog__footer">
    <button class="og-button og-button--ghost" data-og-close>Cancel</button>
    <button class="og-button og-button--danger" data-og-close="delete">Delete</button>
  </footer>
</dialog>

Drawer

Filters

html
<button class="og-button" data-og-open="dialog">Filters</button>
<dialog class="og-dialog og-drawer" id="dialog" aria-labelledby="dialog-t">
  <header class="og-dialog__header">
    <h2 class="og-dialog__title" id="dialog-t">Filters</h2>
    <button class="og-dialog__close" data-og-close aria-label="Close"></button>
  </header>
  <div class="og-dialog__body">
    <label class="og-check"><input type="checkbox" class="og-checkbox" checked /> Paid</label>
    <label class="og-check"><input type="checkbox" class="og-checkbox" /> Overdue</label>
  </div>
</dialog>

React

tsx
import { Dialog, Button } from '@og-ui/react';

const [open, setOpen] = useState(false);

<Button onClick={() => setOpen(true)}>Delete project</Button>
<Dialog
  open={open}
  onOpenChange={setOpen}
  title="Delete project?"
  description="This removes all 24 files."
  footer={<Button variant="danger" data-og-close="delete">Delete</Button>}
/>
// Drawer: <Dialog drawer="left" …>

In every theme

Clean SaaS

Delete project?

This removes all 24 files. You can’t undo it.

Glassmorphism 2.0

Delete project?

This removes all 24 files. You can’t undo it.

Liquid glass

Delete project?

This removes all 24 files. You can’t undo it.

Neumorphism / Soft UI

Delete project?

This removes all 24 files. You can’t undo it.

Claymorphism

Delete project?

This removes all 24 files. You can’t undo it.

Neubrutalism

Delete project?

This removes all 24 files. You can’t undo it.

Aurora / mesh gradient

Delete project?

This removes all 24 files. You can’t undo it.

Keyboard and screen readers

  • Opening moves focus into the dialog (first focusable control).
  • Tab stays inside; the page behind is inert.
  • Esc closes; focus returns to the button that opened it.
  • Buttons with data-og-close close it; clicking the backdrop closes it.
  • For destructive dialogs consider autofocus on Cancel.

Install

bash
npx @og-ui/cli add dialog
npx @og-ui/cli add dialog --react   # with the React component