View Source Pyro.Components.Extra (Pyro v0.1.1)
Original components provided by Pyro.
overridable-component-attributes
Overridable Component Attributes
You can customize the components in this module by configuring overrides.
The components in this module support the following overridable attributes:
:replace:boolean(required):class:tails_classes(required)
:copy:boolean(required):copy_label:string(required):copy_class:tails_classes(required):copy_message:string:class:tails_classes(required)
:ttl:integer(required):case:string(required):color:string(required):shape:string(required):size:string(required):variant:string(required):class:tails_classes(required):message:string(required):icon_class:tails_classes(required)
:is_current:boolean(required):class:tails_classes(required)
:color:string(required):size:string(required):class:tails_classes(required)
:size:string(required):class:tails_classes(required)
:vertical_offset:string(required):horizontal_offset:string(required):tooltip_class:tails_classes(required):tooltip_text_class:tails_classes(required):icon_class:tails_classes:icon_name:string(required):class:tails_classes(required)
Link to this section Summary
Components
Renders a link. This basically wraps Phoenix.Component.link/1 with some overridable attributes, in particular class for consistent, DRY link default styling.
Renders a code block.
Attributes
overrides(:list) - Manually set the overrides for this component (instead of config/default). Defaults tonil.id(:string) (required)value(:string) (required) - Text to copy.label(:string) - Button label, defaults to value. Defaults tonil.disabled(:boolean) - Defaults tofalse.icon_name(:string) - The name of the icon to display (nil for none); seeicon/1for details. Defaults tonil.ttl(:integer) - How long to show the flash message after copying (overridable, required).case(:string) - The case of the text (overridable, required).Must be one of"uppercase","normal-case","lowercase", or"capitalize".color(:string) - The color of the button (overridable, required).shape(:string) - Shape of the button (overridable, required).size(:string) - The size of the button (overridable, required).variant(:string) - Style of button (overridable, required).class(:any) - (overridable,:tails_classes, required).message(:string) - Message to display after copying (overridable, required).icon_class(:any) - (overridable,:tails_classes, required). Global attributes are accepted.
Renders a navigation link, taking into account whether the URI is the current page.
A progress element. Styling the progress element is tricky, so this wraps it with some nice conveniences.
A simple spinner component.
A tooltip component.
Link to this section Components
Renders a link. This basically wraps Phoenix.Component.link/1 with some overridable attributes, in particular class for consistent, DRY link default styling.
attributes
Attributes
overrides(:list) - Manually set the overrides for this component (instead of config/default). Defaults tonil.navigate(:string) - Navigates from a LiveView to a new LiveView. The browser page is kept, but a new LiveView process is mounted and its content on the page is reloaded. It is only possible to navigate between LiveViews declared under the same routerPhoenix.LiveView.Router.live_session/3. Otherwise, a full browser redirect is used.Defaults to
nil.patch(:string) - Patches the current LiveView. Thehandle_paramscallback of the current LiveView will be invoked and the minimum content will be sent over the wire, as any other LiveView diff.Defaults to
nil.href(:any) - Uses traditional browser navigation to the new location. This means the whole page is reloaded on the browser.Defaults to
nil.method(:string) - The HTTP method to use with the link. This is intended for usage outside of LiveView and therefore only works with thehref={...}attribute. It has no effect onpatchandnavigateinstructions. In case the method is notget, the link is generated inside the form which sets the proper information. In order to submit the form, JavaScript must be enabled in the browser.Defaults to
"get".csrf_token(:any) - A boolean or custom token to use for links with an HTTP method other thanget. Defaults totrue.replace(:boolean) - When using:patchor:navigate, should the browser's history be replaced withpushState? (overridable, required)class(:any) - Merge/override default classes of thecodeelement (overridable,:tails_classes, required). Global attributes are accepted.
slots
Slots
inner_block(required) - The content rendered inside of theatag.
Renders a code block.
attributes
Attributes
overrides(:list) - Manually set the overrides for this component (instead of config/default). Defaults tonil.source(:string) (required) - The code snippet.id(:string) (required)copy(:boolean) - (overridable, required).copy_label(:string) - (overridable, required).copy_class(:any) - (overridable,:tails_classes, required).copy_message(:string) - (overridable).language(:string) - Language of the code snippet. Defaults to"elixir".class(:any) - Merge/override default classes of thecodeelement (overridable,:tails_classes, required).
attributes
Attributes
overrides(:list) - Manually set the overrides for this component (instead of config/default). Defaults tonil.id(:string) (required)value(:string) (required) - Text to copy.label(:string) - Button label, defaults to value. Defaults tonil.disabled(:boolean) - Defaults tofalse.icon_name(:string) - The name of the icon to display (nil for none); seeicon/1for details. Defaults tonil.ttl(:integer) - How long to show the flash message after copying (overridable, required).case(:string) - The case of the text (overridable, required).Must be one of"uppercase","normal-case","lowercase", or"capitalize".color(:string) - The color of the button (overridable, required).shape(:string) - Shape of the button (overridable, required).size(:string) - The size of the button (overridable, required).variant(:string) - Style of button (overridable, required).class(:any) - (overridable,:tails_classes, required).message(:string) - Message to display after copying (overridable, required).icon_class(:any) - (overridable,:tails_classes, required). Global attributes are accepted.
A progress element. Styling the progress element is tricky, so this wraps it with some nice conveniences.
attributes
Attributes
overrides(:list) - Manually set the overrides for this component (instead of config/default). Defaults tonil.max(:integer) - Defaults to100.value(:integer) - Defaults to0.color(:string) - The color of the progress bar (overridable, required).size(:string) - The size of the progress bar (overridable, required).class(:any) - The class of the progress bar (overridable,:tails_classes, required). Global attributes are accepted.
A simple spinner component.
attributes
Attributes
overrides(:list) - Manually set the overrides for this component (instead of config/default). Defaults tonil.show(:boolean) - Show or hide spinner. Defaults totrue.size(:string) - The size of the spinner (overridable, required).class(:any) - (overridable,:tails_classes, required). Global attributes are accepted.
A tooltip component.
- JS hook that "nudges" tooltip into view
- Simple props for tooltip text and custom icon
- Optional slots for icon and/or tooltip content
examples
Examples
<.tooltip id="tooltip-1" tooltip="A default tooltip!" />
<.tooltip id="tooltip-2"
icon_name="hero-light-bulb-solid"
tooltip="Custom icon." />
<.tooltip id="tooltip-3">
<:icon>?</:icon>
<div class="bg-red-500 text-white p-4 w-48 shadow-lg rounded">
Custom tooltip slot and custom icon slot.
</div>
</.tooltip>
attributes
Attributes
overrides(:list) - Manually set the overrides for this component (instead of config/default). Defaults tonil.id(:string) (required)tooltip(:string) - Defaults tonil.vertical_offset(:string) - (overridable, required).horizontal_offset(:string) - (overridable, required).tooltip_class(:any) - (overridable,:tails_classes, required).tooltip_text_class(:any) - (overridable,:tails_classes, required).icon_class(:any) - (overridable,:tails_classes).icon_name(:string) - The name of the icon; seeicon/1for details (overridable, required).class(:any) - (overridable,:tails_classes, required).
slots
Slots
iconinner_block