@xsolla/xui-primitives-web
v0.209.1
Published
Internal web primitives for the Xsolla UI Toolkit. Not intended for direct consumer use.
Readme
@xsolla/xui-primitives-web
Internal package — do not use directly. This package is used internally to build toolkit components. Consumers should use the published components (e.g.
@xsolla/xui-button,@xsolla/xui-controls).
Web implementations of XUI primitive components, built with styled-components.
Exports
Box— Flex layout container (div); supports fullBoxPropsincluding hover/press/focus styles and ARIA attributesText— Inline text element; supports colour, fontSize, fontWeight, alignment, andnumberOfLinestruncationSpinner— Animated SVG loading indicatorIcon— SVG icon wrapper accepting child SVG contentDivider— Horizontal or vertical line separator; supports dashed styleInput— Styled<input>element with cross-platform prop interfaceTextArea— Styled<textarea>with optional auto-resize viaautoSize
Text truncation (numberOfLines)
numberOfLines is the cross-platform truncation prop. Native forwards it to
RNText; web emits the equivalent CSS:
| Value | CSS emitted |
| :---- | :---------- |
| unset / 0 | none — the text wraps normally |
| 1 | display: block + white-space: nowrap + overflow: hidden + text-overflow: ellipsis |
| > 1 | display: -webkit-box + -webkit-box-orient: vertical + -webkit-line-clamp: N + overflow: hidden |
Two details are easy to miss when reading the generated CSS:
- The
<span>is promoted todisplay: blockbecausetext-overflowhas no effect on an inline box — without it the ellipsis silently never renders. min-width: 0is emitted so the text can shrink below its own content width inside a flex row. Without it anowraplabel keeps its full intrinsic width and pushes its siblings (leading icons, chevrons) out of a fixed-width field.
Anything passed through the style prop is applied inline and therefore
overrides these rules — callers that need different layout can opt out.
Pair numberOfLines with title to keep the untruncated string reachable on
hover. title is web-only and is ignored on native.
