@web-components/middle-truncate@0.1.39Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
jackcarey/web-componentsWorks with
•JSR Score100%•This package works with BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun




Downloads1/wk
•Published2 months ago (0.1.39)
A component that truncates text in the middle. This is done by measuring the dimensions of the component.
middle-truncate
Truncate text in the middle
- Version: 0.1.39
- License: LGPL-3
Using this package
Browser
- via the ESM CDN: https://esm.sh/jsr/@web-components/middle-truncate
<script src="https://esm.sh/jsr/@web-components/middle-truncate" type="module"></script>
Deno
deno add jsr:@web-components/middle-truncate
NPM
- JSR provides NPM compatibility. You can install this package with:
npx jsr add @web-components/middle-truncate
Documentation
- Open examples for middle-truncate on Storybook.
This package is a work-in-progress. It does not yet work with vertical text.
Attributes:
title- The text to be truncated.disabled- Disable truncation, display the full text string.at- The percentage into the string to truncate at.truncated- Read-only. Whether or not the text is truncated.
Made by jackcarey.
Built and signed on
GitHub Actions
Add Package
deno add jsr:@web-components/middle-truncate
Import symbol
import * as middle_truncate from "@web-components/middle-truncate";
Import directly with a jsr specifier
import * as middle_truncate from "jsr:@web-components/middle-truncate";
Add Package
pnpm i jsr:@web-components/middle-truncate
pnpm dlx jsr add @web-components/middle-truncate
Import symbol
import * as middle_truncate from "@web-components/middle-truncate";
Add Package
yarn add jsr:@web-components/middle-truncate
yarn dlx jsr add @web-components/middle-truncate
Import symbol
import * as middle_truncate from "@web-components/middle-truncate";
Add Package
vlt install jsr:@web-components/middle-truncate
Import symbol
import * as middle_truncate from "@web-components/middle-truncate";
Add Package
npx jsr add @web-components/middle-truncate
Import symbol
import * as middle_truncate from "@web-components/middle-truncate";
Add Package
bunx jsr add @web-components/middle-truncate
Import symbol
import * as middle_truncate from "@web-components/middle-truncate";