API Reference FloUI v0.1.0-alpha

Modules

Setup

FloUI ships with a number of icon assets which much be pulled into your project. Place the following in your assets.ex file. Include scenic assets as well for the fonts.

Usage in SnapFramework

Renders a text input with optional clear button. See Scenic.Component.TextField for more styles.

Usage in SnapFramework

Dropdown component which renders a scroll bar when when the list becomes greater then the height of the dropdown.

Usage in SnapFramework

Render this with children passed to it to automatically lay the children out in the grid. The children must be given width and height styles for it to work. Inspired by https://github.com/BWheatie/scenic_layout_o_matic

Usage in SnapFramework

Render an icon.

Usage in SnapFramework

Render a button with an icon.

Controller for FloUI.Icon.Button

Usage in SnapFramework

Render this behind a modal if you want to block input to primitive render under it.

Usage in SnapFramework

Scrolling layout modal component. Great for displaying content within a modal. If the content needs to scroll within the modal, use FloUI.Modal.ScrollLayout.

Usage in SnapFramework

Scrolling layout modal component. Great for displaying content within a modal that needs to scroll.

NOTICE

This component was originally created by zwetsloot. I have updated it to work with scenic 0.11.0, and added :cursor_scroll event support. Work has been started to write this as a snap component, but this will work as is in snap templates.

Module for calculating the scroll speed for Scenic.Scrollable components.

This module contains helper functions for adding scrollable components to, or modifying scrollable components in a graph. Using the Scenic.Scrollable component will setup scrollbars and controls for you, and is recommended. However, in special cases it might be prefferable to directly use a Scenic.Scrollable.ScrollBars or Scenic.Scrollable.ScrollBar component.

Utility module for limiting certain operations along a certain direction only. A value can be connected to either horizontal or vertical directions.

Module for handling the drag controllability for Scenic.Scrollable components.

This module handles key mappings and keypress events for Scenic.Scrollable components.

Module for applying limits to a position.

The scroll bar component can be used to draw a scroll bar to the scene by adding it to the graph. The scroll bar is used internally by the Scenic.Scrollable component and for most cases it is recommended to use the Scenic.Scrollable component instead.

The scroll bars component can be used to add a horizontal, and a vertical scroll bar pair to the graph. This component is used internally by the Scenic.Scrollable component, and for most cases it is recommended to use the Scenic.Scrollable component instead.

Usage in SnapFramework

Selection lists are a convenient way to have selectable options in list form.

Usage in SnapFramework

A selection list item used by SelectionList.

Usage in SnapFramework

Tab should be passed into the Tabs module as follows.

Usage in SnapFramework

The following example uses FloUI.Tabs and Grid to lay the tabs out. Iterates over the @tabs assign to render each tab. @module.get_tab_width runs FontMetrics on the label to get the width.

Basic theme for sets for FloUI

Usage in SnapFramework

Renders a tooltip.