---
title: "साइज़ ट्रांज़िशन"
description: "ऐसे कंटेंट को लपेटता है जिसका साइज़ बदलता है — बढ़ता हुआ संदेश, एक पंक्ति बढ़ा सेक्शन, एक पंक्ति घटा पैनल — और अपने साइज़ को एक ही मोशन में कंटेंट के नए साइज़ तक ले जाता है, ताकि उसके बाद की चीज़ें झटके से कूदने की जगह आराम से खिसकें, और जिस किनारे पर वह टिका है वह अपनी जगह रहे।"
url: "https://tanrei.chnotchy.com/hi/components/size-transition/"
last_updated: 2026-11-12T17:56:02.000Z
---

> यह पेज Tanrei दस्तावेज़ का हिस्सा है। सभी पेज इंडेक्स [llms.txt](https://tanrei.chnotchy.com/llms.txt) (अंग्रेज़ी में) में दिए गए हैं, और डिफ़ॉल्ट सिस्टम के कंपोनेंट के स्पेक एक ही फ़ाइल [llms-full.txt](https://tanrei.chnotchy.com/llms-full.txt) में हैं।

# साइज़ ट्रांज़िशन

> ऐसे कंटेंट को लपेटता है जिसका साइज़ बदलता है — बढ़ता हुआ संदेश, एक पंक्ति बढ़ा सेक्शन, एक पंक्ति घटा पैनल — और अपने साइज़ को एक ही मोशन में कंटेंट के नए साइज़ तक ले जाता है, ताकि उसके बाद की चीज़ें झटके से कूदने की जगह आराम से खिसकें, और जिस किनारे पर वह टिका है वह अपनी जगह रहे।

## अवलोकन

जब भीतर के कंटेंट का साइज़ बदलता है, तो बॉक्स अभी दिख रहे साइज़ से नए साइज़ तक एक ही मोशन में पहुँचता है। लेआउट में उसके बाद जो कुछ है, वह भी साथ खिसकता है, एक फ़्रेम में कूदता नहीं। यह अपना कुछ नहीं बनाता: न बैकग्राउंड, न बॉर्डर, न गोल कोने, न पैडिंग।

### इस्तेमाल

Web और React के उदाहरण मौजूदा स्पेक दिखाते हैं। SwiftUI, Compose, Flutter और React Native योजना में हैं: वे अभी साइज़ ट्रांज़िशन नहीं देते।

**Web**

```html
<tanrei-size-transition>
  <div id="details"></div>
</tanrei-size-transition>
<p>ब्योरा बदलने पर नीचे का सब कुछ आराम से खिसकता है।</p>

<!-- नीचे टिका हुआ: ऊपर की ओर बढ़ता है, और उसकी आख़िरी पंक्ति अपनी जगह रहती है। -->
<tanrei-size-transition anchor="end">
  <div id="draft"></div>
</tanrei-size-transition>

<script type="module">
  import '@tanrei/web/components/size-transition';
  const box = document.querySelector('tanrei-size-transition');
  box.addEventListener('settle', (event) => console.log(event.detail.height));
  document.querySelector('#details').textContent = longerText; // खिसकता है, कूदता नहीं
</script>
```

**React**

```tsx
import { SizeTransition } from '@tanrei/react';

<SizeTransition onSettle={(event) => setHeight(event.detail.height)}>
  {expanded ? <FullDetails /> : <Summary />}
</SizeTransition>

<SizeTransition axis="inline">
  <span>{saving ? 'सेव हो रहा है…' : 'सेव हो गया'}</span>
</SizeTransition>
```

## स्पेक

- Category: Containment
- Level: base
- Listing: default
- Page: https://tanrei.chnotchy.com/components/size-transition/
- Spec: https://github.com/chnotchy/tanrei/blob/main/specs/size-transition.spec.json

### Availability

| Design system | Has it | Notes |
| --- | --- | --- |
| Tanrei (`tanrei`) | Yes | — |
| Cupertino (Apple HIG-inspired) (`cupertino`) | Yes | — |
| M3-like (Material 3-inspired) (`m3-like`) | Yes | — |

### Platforms

- Web: the element `<tanrei-size-transition>`, registered by importing `@tanrei/web` (or only its own module, `@tanrei/web/components/size-transition`).
- React: `SizeTransition` from `@tanrei/react`.

| Platform | Name | Status |
| --- | --- | --- |
| Web | `tanrei-size-transition` | alpha |
| SwiftUI | `TanreiSizeTransition` | planned |
| Jetpack Compose | `TanreiSizeTransition` | planned |
| Flutter | `TanreiSizeTransition` | planned |
| React Native | `SizeTransition` | planned |

Names a platform gives in its own idiom:

| Spec | Web | SwiftUI | Jetpack Compose | Flutter | React Native |
| --- | --- | --- | --- | --- | --- |
| `duration` (prop) | `duration` | `duration` | `durationMillis` | `duration` | `duration` |
| `disabled` (prop) | `disabled` | `isDisabled` | `enabled` | `disabled` | `disabled` |
| `settle` (event) | `settle` | `onSettle` | `onSettle` | `onSettle` | `onSettle` |

Statuses: `planned` — In the inventory. Nothing shippable exists yet. `lagging` — An implementation of an earlier spec exists; it has not caught up with the current one. `alpha` — Implemented with tests. The API may still change. `beta` — Feature complete and at parity. Only fixes are expected. `stable` — Covered by semantic versioning. `deprecated` — Still shipped; scheduled for removal.

### Anatomy

- `box`: The size transition itself: a box with no look of its own, laid out where it stands, whose size along its axis is the one that moves. It clips what lies beyond it while it moves.
- `content`: Whatever the product puts in it, laid out at its own natural size and fixed to the box's anchor edge. It is measured, never scaled or stretched.

### Props

| Prop | Type | Default | Web attribute | Description |
| --- | --- | --- | --- | --- |
| `axis` | `enum`: `block`, `inline`, `both` | `"block"` | `axis` | Which of its sizes follows the content. block: its height in a horizontal writing mode (the size across lines); its width is the layout's. inline: its width (the size along a line); its height is the layout's. both: both sizes. |
| `anchor` | `enum`: `start`, `end`, `center` | `"start"` | `anchor` | Which edge stays still while the box grows or shrinks. start: the block-start edge (the top) for block, the inline-start edge for inline, so that a growing box uncovers what is new below or after and never moves the first line. end: the opposite edges, for a box docked at its container's end that grows upward (a composer above the keyboard). center: both edges move by half. |
| `duration` | `number` | — | `duration` | How long one change takes, in milliseconds, used as given for every distance. Null, the default, takes the system's answer, which grows with the distance moved (SZT-3). Set it only where one place needs another tempo than every other size transition of the product. |
| `disabled` | `boolean` | `false` | `disabled` | Makes the box follow its content's size at once, without a motion: for a change the person should not watch (a list replaced by a search's results) or a stretch of time in which the content changes at every frame. |

### Events

| Event | Description |
| --- | --- |
| `settle` | The box's size has come to rest after a change, by a motion or at once: emitted once per change, after the last frame, with the box's new width and height in the platform's layout units. A motion that is turned round or retargeted (SZT-2) emits once, at its final rest. |

### Slots

| Slot | Description |
| --- | --- |
| `default` | The content whose size the box follows. Any content: text, a list, another component. |

### States

`enabled`

### Accessibility

- Role: `none (a generic container that exposes nothing of its own)`
- Labeling: The size transition names nothing and is not named; its content keeps its own names, roles and order.
- Minimum target size: yes

- It takes no input, so it has no target of its own; its content keeps its own hit areas.
- A size change is a motion in the sense of WCAG 2.3.3 (animation from interactions): where motion is reduced it happens at once (SZT-7). The opacity of the content is never changed by this component.
- Content that the box clips while it moves stays in the reading and focus order: a person who tabs into it during the motion reaches it, and nothing scrolls to show it (SZT-5) — the motion ends within comp.size-transition.motion.duration-max.
- Browsers count an element moved by a layout change as a layout shift unless a person's input preceded it within a short window. Moving what follows over a motion does not remove it from that count; it removes the jump a person sees. Measure layout shift in a product's own pages.

### Behaviour

Requirements in EARS form, each with its stable id.

- **SZT-1** WHEN the size transition is first drawn THE size transition SHALL take its content's size along its axis in its first frame, without a motion, as every component draws its first frame at rest (MOT-3); content that arrives or changes before that frame is drawn is part of the first frame.
- **SZT-2** WHEN its content's size along its axis changes after the first frame THE size transition SHALL move its own size in the layout, at every frame, from the size it shows to the new one, over the duration SZT-3 gives with comp.size-transition.motion.easing, so that what stands after it moves with it; WHEN the content changes again during the motion THE size transition SHALL go on from the size then shown towards the newest size as one motion, never jumping to the old target or restarting from the old size (MOT-2).
- **SZT-3** WHILE duration is null THE size transition SHALL take the duration of a change from the distance its size moves: comp.size-transition.motion.duration for a distance of up to comp.size-transition.motion.distance-step, plus comp.size-transition.motion.duration-step for each further distance-step begun, and never more than comp.size-transition.motion.duration-max; WHILE duration is a number THE size transition SHALL take that many milliseconds for every distance, 0 meaning at once. The duration of a retargeted motion SHALL be computed from the distance between the size shown and the newest size.
- **SZT-4** WHILE its size differs from its content's THE size transition SHALL clip what lies beyond its box and keep the content fixed to the edge anchor names, mirrored for inline in a right-to-left layout: WHILE anchor is start a growing box SHALL uncover what is new at its block-end (or inline-end) edge and never move its first line, WHILE anchor is end it SHALL uncover what is new at its start edge, the content moving with its end edge, and WHILE anchor is center both edges SHALL move by half the change.
- **SZT-5** WHILE it moves THE size transition SHALL scroll nothing — neither itself nor its content nor an ancestor — to bring a part of the content into view, also WHILE an element inside it has focus, and SHALL leave focus, the caret and a selection where they are (MOT-5).
- **SZT-6** WHEN its content's size changes because the room the layout gives it changed — the window or a pane was resized or turned, the text size changed, the layout direction changed — THE size transition SHALL take the new size at once, so that it never lags behind a person resizing the window; and WHILE a size transition inside its content is moving THE size transition SHALL follow its content at every frame, so that two nested motions move as one and do not compound.
- **SZT-7** WHERE motion is reduced THE size transition SHALL take every new size at once, as size changes are made where motion is reduced (MOT-6), and SHALL still emit settle once per change.
- **SZT-8** WHILE disabled is true THE size transition SHALL follow its content's size at once; WHEN disabled becomes true during a motion THE size transition SHALL take the newest size at once and emit settle.
- **SZT-9** WHILE the size transition is not drawn — hidden, outside a view that is shown, or in an app in the background — THE size transition SHALL take every new size at once, and WHEN it is drawn again it SHALL show its content's size without a motion.
- **SZT-10** THE size transition SHALL expose nothing of its own to assistive technology — no role, no name, no state — and SHALL NOT be a focus stop: its content is read and reached as if the box were not there, including content that the box clips during a motion.
- **SZT-11** WHEN its size has come to rest after a change, by a motion or at once, THE size transition SHALL emit settle exactly once, after the last frame, with its new width and height; it SHALL emit nothing WHEN its content changes without changing its size along its axis.
- **SZT-12** THE size transition SHALL draw nothing of its own — no color, edge, shadow, corner or padding — and SHALL take, on the axes it does not follow, the size its layout gives it; WHILE axis is both it SHALL follow the content's width and height together in one motion of one duration, computed from the larger of the two distances (SZT-3).
- **SZT-13** THE size transition SHALL take its layout direction from where it is used and SHALL have no direction setting of its own; WHEN axis or anchor names a value it does not define THE size transition SHALL use the default value and in debug builds report the unknown value; WHILE duration is a negative number or not a finite number THE size transition SHALL treat it as null and in debug builds report it.

### Tokens

As written in the token documents (DTCG): an alias in braces names the token it takes its value from, which each design system resolves. On the web each token is a CSS custom property: `--tanrei` and the name after `tanrei`, joined by hyphens (`tanrei.comp.size-transition.…` → `--tanrei-comp-size-transition-…`).

#### `tanrei.comp.size-transition`

| Token | Type | Value |
| --- | --- | --- |
| `comp.size-transition.motion.duration` | `duration` | `{tanrei.sys.motion.role.resize.default}` |
| `comp.size-transition.motion.duration-step` | `duration` | `{tanrei.sys.motion.duration.short1}` |
| `comp.size-transition.motion.distance-step` | `dimension` | `{tanrei.sys.space.space800}` |
| `comp.size-transition.motion.duration-max` | `duration` | `{tanrei.sys.motion.role.resize.large}` |
| `comp.size-transition.motion.easing` | `cubicBezier` | `{tanrei.sys.motion.easing.spatial}` |

## दिशानिर्देश

### कब इस्तेमाल करें

साइज़ ट्रांज़िशन को अपने ऐसे कंटेंट के चारों ओर इस्तेमाल करें जिसका साइज़ तब बदलता है जब व्यक्ति उसे देख रहा होता है: जवाब का ड्राफ़्ट जो दूसरी पंक्ति में चला जाता है, सारांश जिसे आप पूरे टेक्स्ट से बदल देते हैं, आपके ख़ुद बनाए फ़ील्ड के नीचे आने वाली एरर की पंक्ति, स्टेटस लेबल जिसका शब्द लंबा हो जाता है। इसके बिना नीचे का सब कुछ एक फ़्रेम में कूद जाता है, और व्यक्ति भूल जाता है कि वह कहाँ पढ़ रहा था।

Tanrei के अपने कंपोनेंट अपने साइज़ के बदलाव पहले से ही मोशन के साथ दिखाते हैं — बढ़ता हुआ टेक्स्ट इनपुट, फैलता हुआ स्नैकबार, खुलता हुआ अकॉर्डियन। इसके लिए उन्हें साइज़ ट्रांज़िशन में लपेटने की ज़रूरत नहीं।

किसी पूरे सेक्शन को माँगने पर दिखाने या छिपाने के लिए [अकॉर्डियन](https://tanrei.chnotchy.com/hi/components/accordion.md) इस्तेमाल करें: खोलना और बंद करना उसका काम है। साइज़ ट्रांज़िशन कुछ नहीं खोलता या बंद करता; वह बस अपने भीतर की चीज़ के साथ चलता है।

### एक बदलाव में कितना समय लगता है

समय दूरी के साथ बढ़ता है। डिफ़ॉल्ट सिस्टम में 64 पिक्सेल तक का बदलाव 300 ms लेता है। उसके बाद हर 64 पिक्सेल, या उसका कोई हिस्सा, 50 ms जोड़ता है, ज़्यादा से ज़्यादा 400 ms तक। इससे बड़ा बदलाव छोटे के बग़ल में हड़बड़ाया हुआ नहीं लगता, और दूर का बदलाव कभी इंतज़ार नहीं कराता। `duration` तभी सेट करें जब किसी एक जगह को आपके प्रोडक्ट के बाक़ी सभी साइज़ ट्रांज़िशन से अलग रफ़्तार चाहिए। `0` पर बदलाव तुरंत होता है।

### ऐक्सिस और टिकने का किनारा चुनना

| ऐक्सिस | किसके लिए |
| --- | --- |
| Block (डिफ़ॉल्ट) | वह कंटेंट जिसकी ऊँचाई बदलती है: पैराग्राफ़, लिस्ट, एक पंक्ति बढ़ा सेक्शन। चौड़ाई लेआउट की होती है। |
| Inline | वह लेबल जिसकी चौड़ाई बदलती है: स्टेटस का शब्द, गिनती, बटन का टेक्स्ट। यह अपने कंटेंट जितना चौड़ा होता है। |
| Both | छोटा बॉक्स जिसकी चौड़ाई और ऊँचाई साथ बदलती है, जैसे दूसरी पंक्ति में जाने वाला बैज। दोनों एक ही मोशन में चलते हैं। |

| टिकने का किनारा | किसके लिए |
| --- | --- |
| Start (डिफ़ॉल्ट) | ज़्यादातर कंटेंट। पहली पंक्ति कभी नहीं खिसकती, और नई चीज़ उसके बाद आती है। |
| End | अपने कंटेनर के आख़िर में टिका कंटेंट, जैसे कीबोर्ड के ऊपर संदेश लिखने की जगह। उसकी आख़िरी पंक्ति अपनी जगह रहती है, और बॉक्स शुरुआत की ओर बढ़ता है। |
| Center | अपनी जगह के बीच में रखी चीज़, जैसे ख़ाली पैनल के बीच की सूचना। |

### करें

- सिर्फ़ उसी कंटेंट को लपेटें जो बदलता है। पूरे पेज के चारों ओर साइज़ ट्रांज़िशन सब कुछ एक साथ खिसकाता है।
- जब कंटेंट हर फ़्रेम में बदल रहा हो — जैसे व्यक्ति भीतर कुछ खींच रहा हो — तब `disabled` इस्तेमाल करें, और ऐसे बदलाव के लिए भी जिसे लोगों को देखने की ज़रूरत नहीं, जैसे खोज के नतीजों से बदली गई लिस्ट।
- बदलाव के बाद नापना या स्क्रॉल करना हो, तो `settle` का इंतज़ार करें: यह आख़िरी फ़्रेम के बाद एक बार आता है।

### न करें

- चीज़ों को फ़ेड के साथ दिखाने या छिपाने के लिए इसे इस्तेमाल न करें। यह सिर्फ़ साइज़ खिसकाता है; फ़ेड कंटेंट का काम है।
- Tanrei के ऐसे कंपोनेंट को साइज़ ट्रांज़िशन में न लपेटें जो अपना साइज़ पहले से मोशन के साथ बदलता है।
- अपने मेट्रिक्स से लेआउट शिफ़्ट हटाने के लिए इस पर भरोसा न करें। ब्राउज़र लेआउट के बदलाव से खिसके एलिमेंट को अब भी गिनते हैं। यह वह झटका हटाता है जो व्यक्ति को दिखता है।

## सुलभता

### कंपोनेंट क्या सँभालता है

- यह सहायक तकनीक को अपना कुछ नहीं देता: न रोल, न नाम, न स्थिति। यह कभी फ़ोकस का पड़ाव नहीं बनता। इसका कंटेंट ऐसे पढ़ा और पाया जाता है जैसे बॉक्स वहाँ हो ही नहीं।
- मोशन के दौरान बॉक्स जिस कंटेंट को काटता है, वह पढ़ने और फ़ोकस के क्रम में बना रहता है। मोशन के दौरान Tab से भीतर आने वाला व्यक्ति उस तक पहुँचता है, और डिफ़ॉल्ट सिस्टम में मोशन 400 ms के भीतर ख़त्म हो जाता है।
- खिसकते समय कुछ भी स्क्रॉल नहीं होता: न बॉक्स, न उसका कंटेंट, न पेज। फ़ोकस, कैरेट और सिलेक्शन अपनी जगह रहते हैं।
- जब मोशन कम करने का अनुरोध हो, तो साइज़ का हर बदलाव तुरंत होता है। `settle` फिर भी हर बदलाव पर एक बार आता है।
- लेआउट से मिली जगह बदलने पर — विंडो का साइज़, टेक्स्ट का साइज़ या दिशा बदलने पर — बदलाव तुरंत होता है, ताकि विंडो का साइज़ बदल रहे व्यक्ति से बॉक्स कभी पीछे न रहे।
- अनजान `axis` या `anchor`, और ऐसी `duration` जो ऋणात्मक हो या संख्या न हो, डीबग बिल्ड में रिपोर्ट की जाती हैं।

### आपको क्या करना है

- कोई ज़रूरी बदलाव ख़ुद बताएँ: लाइव रीजन में, या ऐसी सूचना में जो व्यक्ति देखेगा। साइज़ ट्रांज़िशन सिर्फ़ अपना साइज़ खिसकाता है, कुछ कहता नहीं।
- कंटेंट के अपने नाम, रोल और क्रम सही रखें। साइज़ ट्रांज़िशन इनमें कुछ नहीं जोड़ता।
