mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
24 lines
434 B
Svelte
24 lines
434 B
Svelte
<script>
|
|
// @ts-check
|
|
|
|
/**
|
|
* Specify the truncation direction
|
|
* @type {"end" | "front"}
|
|
*/
|
|
export let clamp = "end";
|
|
|
|
/**
|
|
* Specify the tag name
|
|
* @type {keyof HTMLElementTagNameMap}
|
|
*/
|
|
export let tag = "p";
|
|
</script>
|
|
|
|
<svelte:element
|
|
this="{tag}"
|
|
class:bx--text-truncate-end="{clamp === 'end'}"
|
|
class:bx--text-truncate-front="{clamp === 'front'}"
|
|
{...$$restProps}
|
|
>
|
|
<slot />
|
|
</svelte:element>
|