brumate/ui

brumate/ui

Accessible, unstyled components for brumate. They resume like the rest of a brumate page: a part ships no code until someone uses it.

What the parts give you

Use a part

Import a part from @brumate/ui, and use it as any component:

<script>
  import Button from '@brumate/ui/Button.brm';
  import { $signal } from 'brumate/signals';

  let count = $signal(0);
</script>

<Button class="button" onPress=(() => count++)>Pressed {count} times</Button>

Note

@brumate/ui is in the brumate repository, and is not published yet.

How the parts work together

A part that holds other parts gives them their IDs and state through a context. A TextField names its Label, Input and FieldError for each other:

<TextField name="email" type="email" isRequired>
  <Label>Email</Label>
  <Input />
  <Text slot="description">We send the receipt here.</Text>
  <FieldError />
</TextField>

Browser support

A part uses a feature of the platform only when at least 95% of global usage supports it. So the parts use inert, :focus-visible and checkVisibility(), and not the Popover API, @starting-style or CSS anchor positioning.