Class Transition
Namespace: Neon.Tailwind
Assembly: Neon.Tailwind.dll
Syntax
public class Transition : ComponentBase
Properties
Attributes
Additional attributes.
Declaration
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object> Attributes { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, object> |
BeginTransition
Callback that is fired when the transition is starting.
Declaration
[Parameter]
public EventCallback<bool> BeginTransition { get; set; }
Property Value
Type | Description |
---|---|
EventCallback<bool> |
ChildContent
The child content of the transition.
Declaration
[Parameter]
public RenderFragment<string> ChildContent { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment<string> |
ChildIsVisible
Declaration
public bool ChildIsVisible { get; }
Property Value
Type | Description |
---|---|
bool |
ClassAttributes
Declaration
public string ClassAttributes { get; }
Property Value
Type | Description |
---|---|
string |
CurrentCssClass
Declaration
public string CurrentCssClass { get; }
Property Value
Type | Description |
---|---|
string |
EndTransition
Callback that is fired when the transition has ended.
Declaration
[Parameter]
public EventCallback<bool> EndTransition { get; set; }
Property Value
Type | Description |
---|---|
EventCallback<bool> |
Enter
Classes to add to the transitioning element during the entire enter phase.
Declaration
[Parameter]
public string Enter { get; set; }
Property Value
Type | Description |
---|---|
string |
EnterFrom
The starting point to enter from.
Declaration
[Parameter]
public string EnterFrom { get; set; }
Property Value
Type | Description |
---|---|
string |
EnterTo
The ending point to enter to.
Declaration
[Parameter]
public string EnterTo { get; set; }
Property Value
Type | Description |
---|---|
string |
Id
The tag ID.
Declaration
[Parameter]
public string Id { get; set; }
Property Value
Type | Description |
---|---|
string |
Leave
Classes to add to the transitioning element during the entire leave phase.
Declaration
[Parameter]
public string Leave { get; set; }
Property Value
Type | Description |
---|---|
string |
LeaveFrom
Classes to add to the transitioning element before the leave phase starts.
Declaration
[Parameter]
public string LeaveFrom { get; set; }
Property Value
Type | Description |
---|---|
string |
LeaveTo
Classes to add to the transitioning element immediately after the leave phase starts.
Declaration
[Parameter]
public string LeaveTo { get; set; }
Property Value
Type | Description |
---|---|
string |
Show
Whether the transition should run on initial mount.
Declaration
[Parameter]
public bool? Show { get; set; }
Property Value
Type | Description |
---|---|
bool? |
State
Declaration
public TransitionState State { get; set; }
Property Value
Type | Description |
---|---|
TransitionState |
SuppressInitial
Declaration
[Parameter]
public bool? SuppressInitial { get; set; }
Property Value
Type | Description |
---|---|
bool? |
TransitionGroup
The parent TransitionGroup.
Declaration
[CascadingParameter]
public TransitionGroup TransitionGroup { get; set; }
Property Value
Type | Description |
---|---|
TransitionGroup |
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
RenderTreeBuilder | builder | A RenderTreeBuilder that will receive the render output. |
Overrides
Dispose()
Declaration
public void Dispose()
EnterAsync()
Opens the transition.
Declaration
public Task EnterAsync()
Returns
Type | Description |
---|---|
Task |
GenerateId()
Generates an ID.
Declaration
public static string GenerateId()
Returns
Type | Description |
---|---|
string |
LeaveAsync()
Closes the transition.
Declaration
public Task LeaveAsync()
Returns
Type | Description |
---|---|
Task |
OnAfterRenderAsync(bool)
Method invoked after each time the component has been rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any ElementReference fields will be populated by the time this runs.
This method is not invoked during prerendering or server-side rendering, because those processes are not attached to any live browser DOM and are already complete before the DOM is updated.
Note that the component does not automatically re-render after the completion of any returned Task, because that would cause an infinite render loop.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
bool | firstRender | Set to |
Returns
Type | Description |
---|---|
Task | A Task representing any asynchronous operation. |
Overrides
Remarks
The OnAfterRender(bool) and OnAfterRenderAsync(bool) lifecycle methods
are useful for performing interop, or interacting with values received from @ref
.
Use the firstRender
parameter to ensure that initialization work is only performed
once.
OnInitialized()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.
Declaration
protected override void OnInitialized()
Overrides
OnParametersSetAsync()
Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
Task | A Task representing any asynchronous operation. |
Overrides
SetParametersAsync(ParameterView)
Sets parameters supplied by the component's parent in the render tree.
Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type | Name | Description |
---|---|---|
ParameterView | parameters | The parameters. |
Returns
Type | Description |
---|---|
Task | A Task that completes when the component has finished updating and rendering itself. |
Overrides
Remarks
Parameters are passed when SetParametersAsync(ParameterView) is called. It is not required that the caller supply a parameter value for all of the parameters that are logically understood by the component.
The default implementation of SetParametersAsync(ParameterView) will set the value of each property decorated with ParameterAttribute or CascadingParameterAttribute that has a corresponding value in the ParameterView. Parameters that do not have a corresponding value will be unchanged.
ToggleAsync()
Toggles the transition.
Declaration
public Task ToggleAsync()
Returns
Type | Description |
---|---|
Task |
Events
OnTransitionChange
Declaration
public event Action OnTransitionChange
Event Type
Type | Description |
---|---|
Action |