Sara UI

logo

$currentBreakpoint

Returns the current breakpoint.

Type

Writable<string> | undefined

Example

Example.svelte
<script>
  import { currentBreakpoint } from "saraui"

  $: console.log($currentBreakpoint)
</script>

$sidenav

Allows to manipulate the sidenav.

Type

Writable<{ isOpen: boolean, isCollapsible: boolean, toggle: () => void }> | undefined

Example

Example.svelte
<script>
  import { sidenav, Scaffold, Button } from "saraui"
</script>

<Scaffold>
  <header slot="header">
    ...
  </header>

  <Button onClick={() => $sidenav?.toggle()}>
    Toggle sidenav
  </Button>

  <nav slot="sidenav">
    ...
  </nav>
</Scaffold>