Bar
<sl-bar> | SlBar
Use bar elements for vertical alignment and horizontal distribution.
<sl-bar> <div slot="left"> <span>Just some Text</span> </div> <div slot="center"> <sl-button size="small">A Button</sl-button> <a href="#">A Link</a> <span>Just some Text</span> </div> <div slot="right"> <span>Just some Text</span> <a href="#">A Link</a> <a href="#">A Link</a> </div> </sl-bar>
Examples
<sl-bar> <sl-input slot="left" placeholder="Label" size="small" type="text"></sl-input> <div slot="right"> <sl-button variant="danger" size="small">Zurücksetzen</sl-button> <sl-button variant="success" size="small">Absenden</sl-button> </div> </sl-bar>
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@viur/shoelace@1.0.8-v2.18.0/cdn/components/bar/bar.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@viur/shoelace@1.0.8-v2.18.0/cdn/components/bar/bar.js';
To import this component using a bundler:
import '@viur/shoelace/dist/components/bar/bar.js';
To import this component as a React component:
import SlBar from '@viur/shoelace/dist/react/bar';
Slots
Name | Description |
---|---|
left
|
elements placed left |
center
|
elements placed center |
right
|
elements placed right |
Learn more about using slots.
Parts
Name | Description |
---|---|
left |
The component’s left wrapper. |
center |
The component’s center wrapper. |
right |
The component’s right wrapper. |
Learn more about customizing CSS parts.