Class: DigitScroller
Defined in: src/sdk/components/common/DigitScroller.tsx:61
A scrolling digit display. The display supports number bases greater than or equal to 3. The display renders a one digit for each of the following values:
-(base + 2), -(base + 1), -(base), ... , -1, 0, 1, ... , base, base + 1, base + 2`
The total number of rendered digits equals (base + 2) * 2 + 1
. The display will scroll between the rendered
digits based on a bound value.
When styling the scroller with CSS, select the digit-scroller-digit
class to style all rendered digits. Each
individual digit can also be selected with the digit-scroller-digit-[index]
classes, where [index]
is replaced
with 0, 1, 2, ...
, starting with the lowest-valued digit. Select the digit-scroller-nan
class to style the text
rendered for NaN
values. The --digit-scroller-line-height
variable is used to control the vertical spacing
between each digit (defaults to 1em
). The --digit-scroller-line-offset-y
variable is used to control the
vertical offset of each digit (defaults to 0px
).
Extends
Constructors
Constructor
new DigitScroller(
props
):DigitScroller
Defined in: src/sdk/components/common/DigitScroller.tsx:93
Parameters
Parameter | Type |
---|---|
props | DigitScrollerProps |
Returns
DigitScroller
Inherit Doc
Overrides
Properties
context?
optional
context: [] =undefined
Defined in: src/sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
contextType?
readonly
optional
contextType: readonly [] =undefined
Defined in: src/sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
props
props:
DigitScrollerProps
&ComponentProps
Defined in: src/sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
Methods
destroy()
destroy():
void
Defined in: src/sdk/components/common/DigitScroller.tsx:200
Destroys this component.
Returns
void
Overrides
getContext()
protected
getContext(context
):never
Defined in: src/sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
Parameter | Type | Description |
---|---|---|
context | never | The context to get the subscription for. |
Returns
never
The requested context.
Throws
An error if no data for the specified context type could be found.
Inherited from
onAfterRender()
onAfterRender():
void
Defined in: src/sdk/components/common/DigitScroller.tsx:105
A callback that is called after the component is rendered.
Returns
void
Overrides
DisplayComponent
.onAfterRender
onBeforeRender()
onBeforeRender():
void
Defined in: src/sdk/components/FSComponent.ts:80
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent
.onBeforeRender
render()
render():
VNode
Defined in: src/sdk/components/common/DigitScroller.tsx:157
Renders the component.
Returns
A JSX element to be rendered.