Ir al contenido

Truncate

Un texto largo cortado a unas pocas líneas, con «Verlo completo» para leer el resto.

import { Truncate } from '@sypnia/ui/react'

En esta página
  1. Una descripción larga
  2. Cuándo usarlo
  3. Para todos
  4. Props

Una descripción larga

Tres líneas y luego el botón.

This project keeps the orders, customers and products of the Northwind shop. Orders come from the website and the mobile app; payments are confirmed by the bank a few seconds later, and refunds go back to the same card. Every night a copy of everything is saved for 7 days. The team that runs it is in Medellín, and the support line answers in Spanish and English.
Código
import { Truncate } from '@sypnia/ui/react';

// Three lines, then «Show it whole».
export default function Description() {
  return (
    <Truncate lines={3}>
      This project keeps the orders, customers and products of the Northwind shop. Orders come from the website and the mobile
      app; payments are confirmed by the bank a few seconds later, and refunds go back to the same card. Every night a copy of
      everything is saved for 7 days. The team that runs it is in Medellín, and the support line answers in Spanish and English.
    </Truncate>
  );
}

Cuándo usarlo

Úsalo cuando

  • Descripciones en listas o tarjetas que empujarían todo hacia abajo.

No lo uses cuando

  • El texto es corto: muéstralo.
  • El resto es otro tema: Disclosure.

Para todos

  • El texto completo está en la página; el botón solo lo muestra.

Props

TruncateTipoPor defecto
lines number 3
  1. Una descripción larga
  2. Cuándo usarlo
  3. Para todos
  4. Props

    Busca páginas, secciones y términos