ui-ingredients
TypeScript icon, indicating that this package has built-in type declarations

0.22.0 • Public • Published

UI Ingredients

Headless component library for Svelte powered by zag

Installation

npm install ui-ingredients

Usage

<script>
  import {Dialog, Portal} from 'ui-ingredients';
  import {XCloseIcon, Button} from '$lib/icons';
</script>

<Dialog.Root lazyMount keepMounted>
  <Dialog.Trigger>
    {#snippet asChild(attrs)}
      <Button {...attrs}>Open</Button>
    {/snippet}
  </Dialog.Trigger>

  <Portal>
    <Dialog.Backdrop />
    <Dialog.Positioner>
      <Dialog.Content>
        <Dialog.Title>Title</Dialog.Title>
        <Dialog.Description>Description</Dialog.Description>
        <Dialog.CloseTrigger>
          <XCloseIcon />
        </Dialog.CloseTrigger>
      </Dialog.Content>
    </Dialog.Positioner>
  </Portal>
</Dialog.Root>

Inspiration

  • zag - The fantastic library that powers UI ingredients
  • ark - The outstanding headless component library that greatly inspired this one

Documentation

Browse the documentation for more information on how to use UI Ingredients

Package Sidebar

Install

npm i ui-ingredients

Weekly Downloads

176

Version

0.22.0

License

MIT

Unpacked Size

1.06 MB

Total Files

1326

Last publish

Collaborators

  • calvojp