Saltar al contenido
menumenu tanreiexpand_morecontrasttranslate
tanreiexpand_more
Primeros pasosWebReactSwiftUIJetpack ComposeFlutterReact NativePreajustesTu propio sistema de diseñoUsar Tanrei con agentes de IAMarcaTokens de diseñoSistemas de diseño y personalizaciónTheme StudioColorTipografíaIconosFormaElevaciónMovimientoEstados de interacciónComportamientoDiseño de páginaAccesibilidadTextosTokens de colorTokens de la escala tipográficaTokens de formaTokens de elevaciónTokens de movimientoTokens de estadoTokens de espacio y de medidaComponentesBotónBotón de acción principalBotón segmentadoGrupo de botonesBotón con menúBarra de herramientasBotón de copiarCasilla de verificaciónBotón de opciónInterruptorChipMenúControl deslizanteCampo de control deslizanteCalendarioDateTimePickerGrupo de camposGrupo de botones de opciónGrupo de casillas de verificaciónSelectCampo de selecciónBarra de menúsSubida de archivosSelector de archivos AvanzadoZona de soltar archivosEntrada de texto AvanzadoCampo de textoCampo de chipsCampoCuadro combinado AvanzadoCampo de cuadro combinadoEntrada numérica AvanzadoCampo numéricoEntrada de color AvanzadoCampo de colorEntrada de código de un solo uso AvanzadoCampo de código de un solo usoEntrada de texto incrustada AvanzadoCuadro de redacción de chatTarjetaDivisorCapa modal AvanzadoDiálogoListaFila de listaHoja inferiorHoja lateralCarruselBloque de códigoTablaPopoverPasosAcordeónLista de descripcionesFiguraEstructura de la aplicaciónCabecera de páginaVista de árbolLínea de tiempoVista previa de imágenesTirador de tamañoMarco redimensionableÁrea de desplazamientoInsigniaIndicador de progresoMedidorContador animadoIndicador de cargaSnackbarTooltipAtajo de tecladoTagCódigo en líneaCalloutAvatarEstado vacíoGrupo de tagsEsqueletoElemento de archivoMuestraTexto en marquesinaPestañasVista de pestañasBarra de la aplicaciónBarra de navegaciónPanel de navegaciónBúsquedaEnlacePaginaciónEnlaces anterior y siguienteIndicador de pasosRuta de navegaciónTabla de contenidoTarjeta de enlaceMenú FABEstadoCómo se construye TanreiCómo contribuirLicencia y atribución
InicioComponentesPasos

Pasos

Un procedimiento presentado como pasos numerados, cada uno con un anillo que lleva su número, un título opcional y un cuerpo con tu contenido, unido al siguiente por una línea fina. Es una lista ordenada para leer, nunca un control ni un registro del progreso.

content_copyVer en Markdown
Categoría
Contención
Tokens
comp.steps
Nivel
Base

Descripción general

Web
tanrei-steps
schedule
SwiftUI
TanreiSteps
radio_button_unchecked
Jetpack Compose
TanreiSteps
radio_button_unchecked
Flutter
TanreiSteps
radio_button_unchecked
React Native
Steps
radio_button_unchecked

Generado a partir de docs/status/status.json, specs/steps.spec.json

Títulos y cuerpos

  1. Proponer

    Escribe o cambia la especificación, y los tokens donde el cambio los necesite.

  2. Validar

    Comprueba los esquemas, las reglas de los tokens y el contraste de todos los esquemas de color.

  3. Generar

    Regenera las salidas de los tokens, los andamiajes de código y la matriz de estado.

Hay tres cosas que se parecen y no son lo mismo:

Tipo Qué es Tiene estados Qué dice
Una lista ordenada (prosa) Elementos en un orden, cada uno una expresión o una frase No «Estos, en este orden»
Unos pasos Un procedimiento que se lee y se lleva a cabo en otro lugar No «Haz esto y luego esto»
Un indicador de pasos (stepper) En qué punto está una persona de un flujo que dirige el producto Sí «Estás aquí»

Los pasos no tienen un paso actual, completado ni fallido, y un marcador no es un control. Un proceso de compra o un asistente de configuración necesitan un indicador de pasos, que Tanrei todavía no tiene.

Uso

En la web los pasos son una clase en tu propia lista ordenada, no un elemento. La lista es la del documento antes de que se ejecute ningún script, al <ol> de un renderizador de Markdown le basta una clase y no necesita envoltorio, y sin la hoja de estilos es la lista numerada del navegador.

SwiftUI, Compose, Flutter y React Native están planificados: los nombres que figuran junto a cada plataforma al principio de esta página son los que les da la especificación, y todavía no se distribuye nada para ellos. React tampoco tiene aún un componente Steps, así que usa la lista con la clase.

<link rel="stylesheet" href="@tanrei/web/tokens.css" />
<link rel="stylesheet" href="@tanrei/web/steps.css" />

<!-- Entre controles: un panel, un diálogo, una tarjeta. -->
<ol class="tanrei-steps" role="list">
  <li>Guarda el archivo en la carpeta que contiene los ajustes del proyecto.</li>
  <li>Indica el nombre del archivo en los ajustes.</li>
  <li>Ejecuta la compilación y confirma lo que escribe.</li>
</ol>

<!-- En una página de lectura, con títulos, como continuación de un conjunto anterior. -->
<ol class="tanrei-steps" role="list" data-size="large" start="4" aria-label="El flujo de trabajo, continuación">
  <li>
    <p class="tanrei-steps-title">Implementar</p>
    <p>Construye el cambio en cada plataforma que enumera la especificación.</p>
  </li>
  <li>
    <!-- Un título que es un encabezado de la página: conserva su rol y su nivel. -->
    <h3 id="check">Comprobar</h3>
    <p>Ejecuta todas las comprobaciones en orden.</p>
    <pre><code>pnpm check</code></pre>
  </li>
</ol>

<script type="module">
  // Opcional: la columna de un conjunto con números de tres cifras, la renumeración cuando `start` cambia
  // en tiempo de ejecución y los informes de depuración. `@tanrei/web` también lo carga.
  import '@tanrei/web/steps';
</script>
import '@tanrei/web/steps.css';

<ol className="tanrei-steps" role="list" data-size="large">
  <li>
    <p className="tanrei-steps-title">Instalar</p>
    <p>Añade el paquete al proyecto.</p>
  </li>
</ol>
Propiedad En la web
label aria-label (o aria-labelledby con el encabezado que precede a la lista)
start el start de la propia lista
size: large data-size="large"
un paso <li>
el title de un paso el primer hijo del elemento de lista con class="tanrei-steps-title" (un <p>)
el slot del título un encabezado (de h2 a h6) como primer hijo del elemento de lista

Escribe role="list" en la lista: un motor de navegador retira la semántica de lista de una lista a la que se le quitan los marcadores.

Especificaciones

Una línea cada uno, y un conjunto que continúa

  1. Guarda el archivo en la carpeta que contiene los ajustes del proyecto.
  2. Indica el nombre del archivo en los ajustes, en la clave de la capa de diseño.
  3. Ejecuta la compilación y confirma lo que escribe.
  1. El nueve conserva el círculo.
  2. El diez también.
  3. Y el once: los tres empiezan en el mismo borde.

Large, con un bloque en un cuerpo

  1. Añade el paquete al proyecto.

    npm install @tanrei/web
  2. Carga la hoja de estilos una sola vez, antes que cualquier otro estilo de la página.

  • El marcador es un anillo dibujado con la línea fina del sistema que lleva el número del paso; mide 24 de lado a lado en medium y 28 en large. Con una o dos cifras sigue siendo un círculo; un número más largo lo ensancha hasta convertirlo en una píldora, y el contenido de todos los pasos sigue empezando en el mismo borde.
  • El conector va de cada anillo al siguiente y se detiene antes de tocar ninguno de los dos. El último paso no tiene.
  • El título es opcional. Es texto de su paso y no un encabezado, salvo que des un encabezado como primer hijo del elemento de lista: entonces se dibuja como cualquier título y conserva su rol y su nivel, de modo que el paso figura en el esquema de la página.
  • El cuerpo es tu contenido. Dos bloques quedan a 8 uno de otro, y dos pasos a 16. Un bloque que no es texto (un bloque de código, una tabla, unas pestañas, un callout) ocupa toda la anchura del cuerpo.
  • Los tamaños son los dos de la prosa: medium entre controles, large en una página cuya finalidad es el texto. Los pasos que están dentro de una prosa reciben el tamaño de esa prosa.
  • Los colores: el número, el título y el cuerpo toman el color de contenido de la superficie sobre la que están los pasos. El anillo y el conector se dibujan los dos en el color de la única línea fina del sistema. Nada tiene relleno.

Anatomía

Parte Descripción
1 list The ordered list itself: one column of steps, as wide as its container gives it. It has no fill, no edge, no padding and no state of its own, and it brings no text color.
2 step One item of the list: its marker at the start, and beside it its content — a title, where it has one, and a body. A step has no state: none is current, done or failed.
3 marker What begins a step: a ring in the system's one hairline holding the step's number. At least as high and as wide as the marker's height of the size; a circle in the default system, widened into a pill by a number too long for one. The ring is decorative; the number is the step's number, exposed once with the list item.
4 connector · opcional The line from a step's marker to the next step's: the same hairline, on the marker column's centre line, kept a small distance from both rings. It shows that the steps are one sequence and where a step of several blocks ends. Decorative. The last step has none.
5 title · opcional A step's name, in a few words ("Install", "Say where each output goes"), set at the body's size in a heading weight. Text of its step and not a heading, unless the product gives a heading of its own as the title.
6 body · opcional A step's content: what the product puts in it. Text placed directly takes the body's text style; long-form blocks are set as prose; a block that is not text — a code block, a table, tabs — takes the body's whole width.

Propiedades

Propiedad Tipo Valor predeterminado Descripción
label string "" The list's accessible name, in the product's language ("Installing the package"). Not drawn. Give one where no heading directly before the steps already says what the procedure is.
start number 1 The number of the first step; each following step's number is one more. For a procedure that a note, a heading or a choice between tabs interrupts and that continues in a second set of steps ("4, 5, 6"). A whole number.
size medium | large "medium" The size of the steps' text, in prose's two sizes. Medium sets the body in the interface's own text style, for steps among controls: a panel, a dialog, a card. Large sets it in the style for long reading, for a page whose purpose is the text. Steps inside a prose are given that prose's size. A design system may add values.

Elementos

Los tipos de elemento que el componente repite. Un fixture enumera sus elementos en orden; cada plataforma nombra cada tipo según su propio estilo.

step

One step of the procedure: an optional title and a body. Its number comes from its place in the list and from start, never from a prop of its own.

Propiedad Tipo Valor predeterminado Descripción
title string "" The step's name, in a few words. Plain text: drawn first in the step, read with the step, and not a heading. A title that is a heading of the page is given in the title slot instead.
Slot Descripción
title The title as content of the product's own: a heading of the level the page's outline needs (so the step is in the page's table of contents and can be linked to). Drawn in the title's text style whatever its level; its role and level are kept. Takes the place of the title prop.
Especificación Web SwiftUI Jetpack Compose Flutter React Native
Elemento li TanreiStep TanreiStep TanreiStep Step
title · Propiedad tanrei-steps-title title title title title
Notas An <li> of the list; its children are the body. The title is the item's first child where that child is a heading (h2 to h6) or carries class="tanrei-steps-title" (a <p> for a title that is not a heading): the spec's title prop and its title slot are the same element on this platform, told apart by the tag the product chose. TanreiStep(_ title: String? = nil) { body } in the steps' view builder; TanreiStep(title: { Text(…).accessibilityAddTraits(.isHeader) }) { body } is the title slot. TanreiStep(title: String? = null) { body } in TanreiStepsScope; an overload takes title: @Composable () -> Unit with Modifier.semantics { heading() } for the title slot. TanreiStep(title: 'Install', child: …); titleWidget: takes a widget wrapped in Semantics(header: true) for the title slot. <Step title="Install">…</Step>; title also takes an element with accessibilityRole="header" for the title slot.

Estados

Comportamiento

Requisitos en formato EARS. Cada implementación de plataforma se prueba contra estos identificadores. El texto de los requisitos se muestra tal como está en la especificación, en inglés.

ID Requisito
STP-1 THE steps SHALL lay out its steps in one column, in the order they are given, each step a row of two parts: its marker, in a column at the steps' start edge, and its content — its title, where it has one, and its body — beside it. The marker column SHALL be as wide as the widest marker of the set and never narrower than the marker's height of the size (comp.steps.marker.height.medium for medium, comp.steps.marker.height.large for large), each marker centred in it; every step's content SHALL begin at one edge, comp.steps.marker.gap after that column, and run to the steps' end edge. THE steps SHALL separate the end of one step from the beginning of the next by comp.steps.step.gap, SHALL give the first step no space before it and the last step no space after it, and SHALL draw no fill, no edge around itself and no elevation.
STP-2 THE steps SHALL draw each step's marker as a ring with the step's number at its centre: a box at least comp.steps.marker.height.medium high and wide for medium (comp.steps.marker.height.large for large), with corners comp.steps.marker.shape, never larger than half the box's height and eased by sys.shape.corner-smoothing, no fill, and an edge comp.steps.marker.outline.width wide in comp.steps.marker.outline.color drawn inside the box's size; the number SHALL be set on one line in comp.steps.marker.label.typescale.medium for medium (comp.steps.marker.label.typescale.large for large), in the content color of the surface the steps sit on, with at least comp.steps.marker.padding-inline between it and the ring at the start and at the end, so that a number too long for a circle widens its marker into a pill and is never cut.
STP-3 THE steps SHALL place each marker at the top of its step with its centre on the centre of the step's first line of text — the title's first line where the step has a title, else the first line of the body; WHERE the marker is taller than that line THE steps SHALL lower the step's content by half the difference, so that the marker's top is the step's top and no marker reaches into the space above its step; WHERE a step begins with a block that is not text (a code block, a table, a picture) THE steps SHALL place the marker's top on that block's top.
STP-4 THE steps SHALL number its steps in order: the first step's number is start and each following step's is one more than the one before it. THE number SHALL be written as a whole number in the digits 0 to 9, with no period, bracket or other mark beside it and no word before it. WHEN a step is added, removed or moved, or start changes, THE steps SHALL draw every step's new number at once, without a motion.
STP-5 WHILE a step is followed by another step THE steps SHALL draw a connector between their two markers: a straight line comp.steps.connector.thickness thick in comp.steps.connector.color, on the centre line of the marker column, from comp.steps.connector.gap below the upper marker's bottom edge to comp.steps.connector.gap above the lower marker's top edge, through the space between the two steps, however tall the upper step's content is. THE steps SHALL draw no connector after the last step and none for a set of one step; a connector SHALL take no room in the layout, SHALL never be drawn over a marker or over a step's content, and SHALL be kept from assistive technology.
STP-6 WHERE a step has a title THE steps SHALL draw it first in the step's content, in comp.steps.title.typescale.medium for medium (comp.steps.title.typescale.large for large) and the content color of the surface the steps sit on, SHALL wrap it and never cut it, and SHALL begin the step's body comp.steps.title.gap below it. A title given as text SHALL be exposed as text of its step and SHALL NOT be a heading; WHERE the product gives the title as content of its own in the step's title slot — a heading of the level its page's outline needs — THE steps SHALL draw it as any title, in the same text style whatever its level, and SHALL change neither its role nor its level. A step with a title and no body SHALL be drawn as its marker and its title alone. THE steps SHALL set the title's letter-spacing by the script of its text, as every title is set (PRS-20): no negative letter-spacing WHERE its language is Chinese, Japanese or Korean, and none WHERE its script joins its letters or stacks marks on them.
STP-7 THE steps SHALL draw the content a step is given as that step's body and SHALL give it comp.steps.body.typescale.medium for medium (comp.steps.body.typescale.large for large) as the text style its text takes where nothing inside sets another. THE steps SHALL give the body no color of its own: its text takes the content color of the surface the steps sit on, so the same steps read on a page, in a card and in a callout. The body SHALL wrap and SHALL never be cut or limited to a number of lines. WHERE the body holds more than one block THE steps SHALL separate two blocks that follow each other by comp.steps.body.gap, whatever they are, and SHALL give the first block no space before it and the last block no space after it; the body's long-form blocks — paragraphs, lists, a quote — SHALL otherwise be set as prose of the steps' size sets them (PRS-1 to PRS-3, PRS-19), a link in them SHALL be underlined at rest (PRS-17), and THE steps SHALL add no style to anything inside a component placed in a body.
STP-8 THE steps SHALL give every block of a body that is not text — a code block, a table, a set of tabs, a callout, a figure or a picture, any component — the whole inline size of the body, from the edge every step's content begins at (STP-1) to the steps' end edge, and such a block SHALL scroll inside its own box when its content cannot shrink (PRS-15). WHILE the steps sit in a prose that keeps a measure THE steps themselves SHALL take that prose's full width as a block that is not text (PRS-18), and the text blocks of a body SHALL be kept no wider than comp.prose.measure times their font size, from the body's start edge; WHERE the steps sit outside a prose, or in one without a measure, every block of a body SHALL take the body's full inline size.
STP-9 WHERE a step's body holds a list THE steps SHALL leave it a list of prose, nested one depth below the steps: an ordered list is marked with lowercase letters and an unordered one with a ring (PRS-9's second depth), set in by prose's own inset from the body's start edge, so that sub-steps never repeat the steps' numbers and never draw markers or connectors of their own. WHERE the product places a set of steps inside a step's body THE steps SHALL draw it as a set of its own, numbered from its own start and laid out in the body's width, and in debug builds SHALL report that steps are nested.
STP-10 THE steps SHALL lay itself out as a block in the flow of its container: it SHALL take the whole inline size the container gives it, with its start edge on the start edge of the text around it; it SHALL bring no outer space of its own (PRS-15: the space between it and its neighbours is its container's), SHALL never be wider than its container, SHALL have no minimum width and no maximum width, and SHALL NOT scroll.
STP-11 THE steps SHALL NOT take pointer, touch or keyboard input, SHALL NOT take focus or be a stop in the focus order, and SHALL NOT change anything they draw under a pointer, a press or focus: a step has no current, completed, error, hovered, focused, pressed, selected or disabled state, a marker is not a control, and the steps emit no event. What the product places in a body — a link, a code block's copy button, tabs — takes input by its own spec, and text in a title and a body SHALL remain selectable where the platform lets text be selected.
STP-12 THE steps SHALL be exposed to assistive technology as an ordered list of as many items as it has steps, named by label where label is not empty, and each step as one item of that list holding, in this order, its number, its title and its body. Each step's number SHALL be exposed exactly once, as the item's number, and SHALL be the number the marker draws (STP-4), also where start is not 1; the ring and the connector SHALL be kept from assistive technology. THE steps SHALL NOT expose a step as current, done or failed, and SHALL add no role to a title or to anything in a body.
STP-13 WHEN label, a step's title or a step's body changes THE steps SHALL draw and expose the new value at once, without a motion, and SHALL NOT announce the change by itself.
STP-14 WHILE the text size is enlarged THE steps SHALL grow each number, title and body with it and grow each marker with its number, keeping the marker's height of the size as a minimum; THE steps SHALL keep comp.steps.marker.gap, comp.steps.step.gap, comp.steps.title.gap, comp.steps.body.gap and comp.steps.connector.gap as they are, wrap, set no fixed height on a step, lose no content when the reader raises line height, paragraph spacing, letter spacing or word spacing, and SHALL need no horizontal scrolling at a width of 320 points with text at 200 %, except inside a block that scrolls in its own box (STP-8).
STP-15 WHERE the platform draws with a person's own forced colors (the web's forced-colors mode, and a platform's equivalent where it has one) THE steps SHALL draw each ring and each connector in the platform's text color at their own widths, and each number, title and body in that text color; nothing the steps draw relies on a fill.
STP-16 WHERE the layout direction is right-to-left THE steps SHALL mirror its two parts and apply its spaces by logical start and end, so that the marker column and the connectors are at the right and each step's content is at its left, beginning at one edge and running to the steps' left edge; a body's blocks that are not text SHALL still take the body's whole inline size (STP-8).
STP-17 THE steps SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the steps are shown THE steps SHALL draw themselves for the new direction at once, without a motion of their own, keeping what they show.
STP-18 THE steps SHALL draw a step's number as a left-to-right run whose digits are never reversed, in every layout direction, and SHALL lay out a title given as text as text of its own direction, isolated from the text around it: it takes the base direction of its first strong character, or the layout direction where it has none, so that a command, a file's name and a version keep their own order in a right-to-left layout and reorder nothing beside them; THE steps SHALL still place the title and align its lines by the layout direction, not by the text's own. The body's blocks are laid out as prose lays out a block (PRS-25): each by its own first strong character unless the content states a direction, with its lines aligned to the start edge of the layout.
STP-19 WHEN size names a value that the active design system does not have THE steps SHALL render with the default size's tokens, and in debug builds report the unknown value. IF start is not a whole number THE steps SHALL number from 1 and in debug builds report it; a start of zero or below is a whole number and is drawn as it is.
STP-20 IF the steps hold no step THE steps SHALL draw nothing, take no space and expose nothing, and in debug builds report that a set of steps is empty. IF a step has neither a title nor a body THE steps SHALL still draw its marker, count it in the numbering and in the list's items, and in debug builds report that a step is empty: a number is never skipped, so the numbers a reader sees are the numbers the content has.

Correspondencia de nombres por plataforma

Paridad no significa API idénticas. Cada plataforma expresa el mismo contrato con su propio estilo.

Especificación Web SwiftUI Jetpack Compose Flutter React Native
Componente tanrei-steps TanreiSteps TanreiSteps TanreiSteps Steps
label · Propiedad aria-label label label semanticLabel accessibilityLabel
start · Propiedad start start start start start
size · Propiedad data-size size size size size
Notas Form: a class on the product's own ordered list, not an element — <ol class="tanrei-steps" role="list"> with <li> children — styled by one optional stylesheet of the package, @tanrei/web/steps.css, whose selectors are wrapped in :where() so one class on the product's side wins. The list stays the document's list: it is an ordered list before any script runs and for whatever reads the page as built, a Markdown renderer's <ol> needs one class and no wrapper, and there is nothing to define, so nothing changes place after the page loads; without the stylesheet it is the browser's numbered list. start is the <ol>'s own attribute, label is aria-label (or aria-labelledby naming the heading before it), data-size="large" is the size. The marker is the item's ::before showing the item's number from a counter that honours start (the implicit list-item counter where the three engines agree on it, else a counter of the stylesheet's set from start by the package's script); the connector is the item's ::after, absolutely placed, with pointer-events: none. One shared marker column (STP-1) is a grid on the <ol> with the items as subgrids. list-style: none removes list semantics in one engine's accessibility tree, which is why the contract writes role="list" on the <ol>; the number in ::before is generated content, read once with the item (STP-12), and the test of STP-12 is run with a screen reader in each engine. The number is drawn with unicode-bidi: isolate and direction: ltr (STP-18); a title is dir="auto"-like through unicode-bidi: plaintext with physical alignment by :dir(), as productText() does. STP-3 uses 1lh of the item's first line. Inside a .tanrei-prose the list is not an island (it is a class on an <ol>, not a Tanrei element), so prose's own rules keep reaching the paragraphs, lists, links and inline code of each body at any depth, with no second prose to open and no limit of depth; steps.css takes back from prose.css what a set of steps draws itself: the list's inset, its markers, the item gap, the measure on the list (STP-8) and the gap between an item's blocks (STP-7), and a list inside an item is already prose's second depth (STP-9). Outside a prose the stylesheet alone sets the body's text style and the gaps between an item's direct children; long-form content there is wrapped by the product in <div class="tanrei-prose" data-measure="false"> around the list. Under forced-colors: active the ring and the connector are CanvasText (STP-15). The package's script, where it is loaded, adds only the debug reports of STP-9, STP-19 and STP-20. React: Steps and Step render the same <ol> and <li>; Step takes title (text, rendered as <p class="tanrei-steps-title">) or a heading as its first child. TanreiSteps(label:, start:, size:) { TanreiStep("Install") { … } }. A Layout that measures the widest marker, places contents at one edge and draws the connectors in a background; not a List, so it brings no rows, separators or scrolling. Each step is an accessibility container whose first element's label is the number; the set is exposed as a list through the platform's list semantics where it has them and named by label. The body is the product's views; rendered text goes through the prose layout. TanreiSteps(label, start, size) { TanreiStep("Install") { … } }. A custom Layout, not a LazyColumn: a procedure is short and is never recycled. CollectionInfo and CollectionItemInfo expose the list and each item; the number is the first text of the item; the ring and the connector are drawn in drawBehind and have no semantics. TanreiSteps(semanticLabel:, start:, size:, children: [TanreiStep(…)]). Not the framework's Stepper, which is a control with a current step. A CustomMultiChildLayout-style render object for the shared column; connectors painted by a CustomPainter excluded from semantics. Follows Directionality. <Steps accessibilityLabel="…" start={1} size="medium"><Step title="Install">…</Step></Steps>. accessibilityRole="list" on the container; each step's number is the first text of its item. The marker column's width is measured once per set (onLayout). Follows the app's direction where an ancestor's is not known.

Tokens

Token Alias de Valor resuelto (claro)
--tanrei-comp-steps-body-gap sys.space.space100 8px
--tanrei-comp-steps-connector-color sys.color.outline-variant #000000 · 8%
--tanrei-comp-steps-connector-gap sys.space.space50 4px
--tanrei-comp-steps-connector-thickness sys.border.hairline 1px
--tanrei-comp-steps-marker-gap sys.space.space150 12px
--tanrei-comp-steps-marker-height-large — 28px
--tanrei-comp-steps-marker-height-medium — 24px
--tanrei-comp-steps-marker-outline-color sys.color.outline-variant #000000 · 8%
--tanrei-comp-steps-marker-outline-width sys.border.hairline 1px
--tanrei-comp-steps-marker-padding-inline sys.space.space50 4px
--tanrei-comp-steps-marker-shape sys.shape.corner.full 9999px
--tanrei-comp-steps-step-gap sys.space.space200 16px
--tanrei-comp-steps-title-gap sys.space.space50 4px
--tanrei-comp-steps-body-typescale-large sys.typescale.body-large 400 16px/1.625
--tanrei-comp-steps-body-typescale-medium sys.typescale.body 400 14px/1.5714
--tanrei-comp-steps-marker-label-typescale-large sys.typescale.label 500 14px/1.4286
--tanrei-comp-steps-marker-label-typescale-medium sys.typescale.label-small 500 12px/1.3333
--tanrei-comp-steps-title-typescale-large sys.typescale.heading-5 500 16px/1.5
--tanrei-comp-steps-title-typescale-medium sys.typescale.heading-6 500 14px/1.4286

Fixtures

Representaciones canónicas. Todas las plataformas capturan cada fixture con el mismo identificador para poder comparar los resultados.

Generado a partir de specs/steps.spec.json, tokens/comp/steps.tokens.json, design/tokens/

En la prosa

Dentro de .tanrei-prose los pasos no son una isla: los párrafos, las listas, los enlaces y el código en línea de cada paso siguen siendo los de la prosa. Los pasos ocupan toda la anchura de la prosa, así que un bloque de código dentro de un paso ocupa la columna, y los párrafos de un paso siguen deteniéndose en la medida. Una lista dentro de un paso se marca con letras (si es ordenada) o con anillos (si no lo es), de modo que los subpasos nunca repiten los números de los pasos. @tanrei/web/prose.css incluye las reglas de los pasos, así que una página de prosa no necesita una segunda hoja de estilos.

Qué dibuja la web de otra manera

  • Con un título, escribe el cuerpo en elementos (<p>): al texto escrito directamente después de un título no se le puede dar la separación que va debajo de este.
  • En una prosa que mantiene una medida, un paso que es solo texto se limita a la medida. El texto escrito directamente en un paso que además contiene bloques no: escríbelo en un <p>.
  • Un paso que empieza con un bloque de código o una imagen tiene la parte superior de su marcador a la altura de la parte superior de ese bloque. La hoja de estilos no ve el texto escrito directamente antes de un bloque así (un elemento compacto de Markdown): escríbelo en un <p>.
  • Un número de tres cifras o más ensancha su marcador hasta convertirlo en una píldora. La columna de marcadores de todo el conjunto solo lo acompaña con el script del paquete, que la mide; sin el script, un marcador así invade la separación que tiene al lado.
  • Sin el script del paquete, dos motores de navegador no vuelven a dibujar un cambio de start en tiempo de ejecución.

Pautas

Recomendado

  • Di qué procedimiento es en un encabezado o en una frase que lo preceda. Donde nada lo diga, da a la lista un label.
  • Limita cada paso a una acción y a lo que quien lee necesita para llevarla a cabo.
  • Usa start para continuar un procedimiento que una nota o una elección entre pestañas interrumpe.
  • Usa una lista ordenada de la prosa, sin la clase, para elementos que son una expresión cada uno y no un procedimiento.

Evita

  • No uses los pasos para mostrar el progreso por un flujo. Ningún paso es el actual ni está hecho.
  • No anides pasos dentro de pasos. Los subpasos son una lista ordenada en el cuerpo.
  • No conviertas todos los títulos en encabezados: una página cuyo esquema enumera todos los pasos de todos los procedimientos es más difícil de recorrer.

Accesibilidad

Rol
list
Etiquetado
An ordered list, named by label where the product gives one; where a heading directly before the steps says what the procedure is, no label is needed. Each step is a list item read as its number, its title and its body, in that order. The number is the list item's own and is read once; the ring and the connector are decorative and hidden. A title is text of its item, or the product's own heading where the product gave one.
Objetivo mínimo
El área de pulsación cumple el tamaño mínimo de objetivo aunque el tamaño visual sea menor. minimum 32px · pointer 44px · spacing 8px · touch 48px

Teclado

Teclas Acción

Notas

  • Not interactive: the steps take no input and no focus (STP-11), so there is no target of their own to size and minimumTarget holds trivially. What is pressable inside a body — a link, a copy button, tabs — meets the minimum target by its own spec.
  • Order is carried by structure, not by the drawing: the steps are an ordered list whose items have numbers (STP-12), so a reader who does not see the rings and the connector loses nothing. That is also why forced colors and a missing stylesheet cost nothing but the look.
  • The number a person hears is the number a person sees (STP-12), also for a set that continues another with start. A platform whose list semantics would announce a position ("1 of 3") in place of the drawn number adds the number to the item's text instead of relying on the position.
  • Contrast is the surface's: the steps bring no text color (STP-2, STP-6, STP-7), so the number, the title and the body have the contrast of the content color of the surface they sit on, which the default system holds to 4.5:1. The ring and the connector are decorative — the number is read without the ring, and the order without the line — and are not held to 3:1, as the divider's line and a quote's line are not.
  • A title is not a heading by default, because a page whose outline lists every step of every procedure is harder to move through by headings. Where the steps are the page's sections (a long guide with one screen of content per step), give each title as a heading in the title slot; its level is the page's, and the steps do not change it (STP-6).
  • Steps say nothing about progress (STP-11, STP-12): no step is current, done or failed, and none can be. A flow in which the person is somewhere — a checkout, a set-up wizard — needs a component that exposes the current step, which this is not.
  • Text size, text spacing and reflow: STP-14. A long procedure is never cut, collapsed or paged by the component.

Generado a partir de specs/steps.spec.json, tokens/sys/measure.tokens.json

De qué se encarga el componente

  • Sigue siendo la lista ordenada del documento: una lista con tantos elementos como pasos, cada uno leído como su número, su título y su cuerpo.
  • El número que una persona oye es el número que una persona ve, también en un conjunto que continúa otro con start.
  • El anillo y el conector son decorativos y están ocultos. El orden lo transmite la lista, así que no se pierde nada con colores forzados ni sin la hoja de estilos.
  • El texto crece con los ajustes de quien lee y salta de línea. Solo un bloque que se desplaza dentro de su propia caja, como un bloque de código, se desplaza hacia los lados.

Qué debes hacer tú

  • Escribe role="list" en la lista.
  • Da nombre al procedimiento con un encabezado que lo preceda, o con aria-label.
  • Da un título como encabezado solo donde los pasos sean secciones de la página.