Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score100%
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

middle-truncate component on Storybook middle-truncate version on JSR JSR score

Truncate text in the middle

  • Version: 0.1.39
  • License: LGPL-3

Using this package

Browser

<script src="https://esm.sh/jsr/@web-components/middle-truncate" type="module"></script>

Deno

deno add jsr:@web-components/middle-truncate

NPM

npx jsr add @web-components/middle-truncate

Documentation

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

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@web-components/middle-truncate

Import symbol

import * as middle_truncate from "@web-components/middle-truncate";
or

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
or (using pnpm 10.8 or older)
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
or (using Yarn 4.8 or older)
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";