Rokkit is a data-driven, configurable, and themeable UI library built for use with Svelte. Rokkit controls are designed to be easily themeable, so you can match the look and feel of your project with minimal effort.
Rokkit provides both composable and data-driven components.
Rokkit is currently under development and not feature complete yet.
Components have been separated into the following packages. Refer to the package stories for examples of all available UI components. View a live demo here
To install Rokkit, use the following command:
degit jerrythomas/rokkit/sites/quick-start my-app
pnpm i
To use Rokkit in your Svelte project, simply import the desired control and use it in your template like any other Svelte component. For example, to use the List control:
<script>
import { List } from '@rokkit/ui'
</script>
<List items={['a', 'b', 'c']} />
One of the key features of Rokkit is its data-driven controls. These controls automatically bind to your data and update its state whenever the data changes. All data-driven components follow a consistent pattern. Selection components that work on arrays have an items
property and all components have a value
property that has the current value.
<script>
import { List } from '@rokkit/ui'
let items = ['a', 'b', 'c']
let value
</script>
<List {items} bind:value />
To apply a theme to your controls, simply pass a theme prop to the body element.
<svelte:body class="rokkit dark" />
If you want to provide users the option of switching between dark theme and light mode or custom themes, then you can also use the themable
action with the ToggleThemeMode
component.
<script>
import { themable } from '@rokkit/actions'
import { ToggleThemeMode } from '@rokkit/ui'
</script>
<svelte:body use:themable />
<ToggleThemeMode />
For more detailed documentation on each control, including a list of all available props and usage examples, please refer to the Rokkit documentation on our website.
We hope you enjoy using Rokkit in your projects!
degit jerrythomas/rokkit/sites/quick-start my-app
cd my-app
pnpm i
pnpm dev