` element directly. + +For example, when rendering a collection of items in an `ion-list`: + +```html + + + First item + Second item + ... + + + + + + +``` + +Please refer to the [ARIA: feed role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/feed_role) documentation for additional information. + +## Interfaces + +### InfiniteScrollCustomEvent + +While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with Ionic events emitted from this component. + +```typescript +interface InfiniteScrollCustomEvent extends CustomEvent { + target: HTMLIonInfiniteScrollElement; +} +``` + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/input.md b/versioned_docs/version-v6/api/input.md new file mode 100644 index 00000000000..3f439459ada --- /dev/null +++ b/versioned_docs/version-v6/api/input.md @@ -0,0 +1,153 @@ +--- +title: 'ion-input' +--- + +import Props from '@ionic-internal/component-api/v6/input/props.md'; +import Events from '@ionic-internal/component-api/v6/input/events.md'; +import Methods from '@ionic-internal/component-api/v6/input/methods.md'; +import Parts from '@ionic-internal/component-api/v6/input/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/input/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/input/slots.md'; + + + ion-input: Custom Input Value Type Styling and CSS Properties + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +The input component is a wrapper to the HTML input element with custom styling and additional functionality. It accepts most of the same properties as the HTML input, but works great on desktop devices and integrates with the keyboard on mobile devices. + +## Basic Usage + +import Basic from '@site/static/usage/v6/input/basic/index.md'; + + + +## Types + +The input component is meant for text type inputs only, such as `"text"`, `"password"`, `"email"`, `"number"`, `"search"`, `"tel"`, and `"url"`. It supports all standard text input events including keyup, keydown, keypress, and more. The default `type` is `"text"`. + +import Types from '@site/static/usage/v6/input/types/index.md'; + + + +## Label Positioning + +Labels will take up the width of their content by default. This positioning can be changed to be a fixed width, stacked, or floating label. + +import Labels from '@site/static/usage/v6/input/labels/index.md'; + + + +## Clear Options + +Inputs offer two options for clearing the input based on how you interact with it. The first way is by adding the `clearInput` property which will show a clear button when the input has a `value`. The second way is the `clearOnEdit` property which will clear the input after it has been blurred and then typed in again. Inputs with a `type` set to `"password"` will have `clearOnEdit` enabled by default. + +import Clear from '@site/static/usage/v6/input/clear/index.md'; + + + +## Filled Inputs + +Material Design offers filled styles for an input when it is inside of an item. The `fill` property on the item can be set to either `"solid"` or `"outline"`. + +import Fill from '@site/static/usage/v6/input/fill/index.md'; + + + +## Helper & Error Text + +Helper & error text can be used inside of an item with an input by slotting a note in the `"helper"` and `"error"` slots. The error slot will not be displayed unless the `ion-invalid` class is added to the `ion-item`. In Angular, this is done automatically through form validation. In JavaScript, React and Vue, the class needs to be manually added based on your own validation. + + + +import HelperError from '@site/static/usage/v6/item/helper-error/index.md'; + + + +## Item Counter + +The item counter is helper text that displays under an input to notify the user of how many characters have been entered out of the total that the input will accept. When adding counter, the default behavior is to format the value that gets displayed as `inputLength` / `maxLength`. This behavior can be customized by passing in a formatter function to the `counterFormatter` property. + + + +import Counter from '@site/static/usage/v6/item/counter/index.md'; + + + +## Filtering User Input + +Developers can use the `ionInput` event to update the input value in response to user input such as a keypress. This is useful for filtering out invalid or unwanted characters. + +When storing the value in a state variable, we recommend updating both the state variable and the `ion-input` component value. This ensures that the state variable and the `ion-input` component value remain in sync. + +import FilteringData from '@site/static/usage/v6/input/filtering/index.md'; + + + +## Theming + +### Colors + +import Colors from '@site/static/usage/v6/input/theming/colors/index.md'; + + + +### CSS Custom Properties + +Input uses scoped encapsulation, which means it will automatically scope its CSS by appending each of the styles with an additional class at runtime. Overriding scoped selectors in CSS requires a [higher specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) selector. Targeting the `ion-input` for customization will not work; therefore we recommend adding a class and customizing it that way. + +import CSSProps from '@site/static/usage/v6/input/theming/css-properties/index.md'; + + + +## Interfaces + +### InputChangeEventDetail + +```typescript +interface InputChangeEventDetail { + value: string | undefined | null; +} +``` + +### InputCustomEvent + +While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with Ionic events emitted from this component. + +```typescript +interface InputCustomEvent extends CustomEvent { + detail: InputChangeEventDetail; + target: HTMLIonInputElement; +} +``` + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/item-divider.md b/versioned_docs/version-v6/api/item-divider.md new file mode 100644 index 00000000000..cf5cb8cad4a --- /dev/null +++ b/versioned_docs/version-v6/api/item-divider.md @@ -0,0 +1,68 @@ +--- +title: 'ion-item-divider' +--- + +import Props from '@ionic-internal/component-api/v6/item-divider/props.md'; +import Events from '@ionic-internal/component-api/v6/item-divider/events.md'; +import Methods from '@ionic-internal/component-api/v6/item-divider/methods.md'; +import Parts from '@ionic-internal/component-api/v6/item-divider/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/item-divider/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/item-divider/slots.md'; + + + Item Divider | List Item Divider Block Element for Ionic Apps + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +Item dividers are block elements that can be used to separate [items](./item) in a list. They are similar to list headers, but instead of only being placed at the top of a list, they should go in between groups of items. + +## Basic Usage + +import Basic from '@site/static/usage/v6/item-divider/basic/index.md'; + + + +## Theming + +### Colors + +import Colors from '@site/static/usage/v6/item-divider/theming/colors/index.md'; + + + +### CSS Custom Properties + +import CSSProps from '@site/static/usage/v6/item-divider/theming/css-properties/index.md'; + + + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/item-group.md b/versioned_docs/version-v6/api/item-group.md new file mode 100644 index 00000000000..c4909aa35b8 --- /dev/null +++ b/versioned_docs/version-v6/api/item-group.md @@ -0,0 +1,58 @@ +--- +title: 'ion-item-group' +--- + +import Props from '@ionic-internal/component-api/v6/item-group/props.md'; +import Events from '@ionic-internal/component-api/v6/item-group/events.md'; +import Methods from '@ionic-internal/component-api/v6/item-group/methods.md'; +import Parts from '@ionic-internal/component-api/v6/item-group/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/item-group/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/item-group/slots.md'; + + + ion-item-group: Group Items to Divide into Multiple Sections + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + +Item groups are containers that organize similar [items](./item) together. They can contain [item dividers](./item-divider) to divide the items into multiple sections. They can also be used to group [sliding items](./item-sliding). + +## Basic Usage + +import Basic from '@site/static/usage/v6/item-group/basic/index.md'; + + + +## Sliding Items + +import SlidingItems from '@site/static/usage/v6/item-group/sliding-items/index.md'; + + + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/item-option.md b/versioned_docs/version-v6/api/item-option.md new file mode 100644 index 00000000000..8ef658c9bd8 --- /dev/null +++ b/versioned_docs/version-v6/api/item-option.md @@ -0,0 +1,50 @@ +--- +title: 'ion-item-option' +--- + +import Props from '@ionic-internal/component-api/v6/item-option/props.md'; +import Events from '@ionic-internal/component-api/v6/item-option/events.md'; +import Methods from '@ionic-internal/component-api/v6/item-option/methods.md'; +import Parts from '@ionic-internal/component-api/v6/item-option/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/item-option/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/item-option/slots.md'; + + + ion-item-options: Option Button Components for Ionic Apps + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +The item option component is an button for a sliding item. It must be placed inside of [item options](./item-options). The `ionSwipe` event and the `expandable` property can be combined to create a full swipe action for the item. + +See the [item sliding](./item-sliding) documentation for more information. + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/item-options.md b/versioned_docs/version-v6/api/item-options.md new file mode 100644 index 00000000000..6035574119c --- /dev/null +++ b/versioned_docs/version-v6/api/item-options.md @@ -0,0 +1,55 @@ +--- +title: 'ion-item-options' +--- + +import Props from '@ionic-internal/component-api/v6/item-options/props.md'; +import Events from '@ionic-internal/component-api/v6/item-options/events.md'; +import Methods from '@ionic-internal/component-api/v6/item-options/methods.md'; +import Parts from '@ionic-internal/component-api/v6/item-options/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/item-options/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/item-options/slots.md'; + + + ion-item-options: Option Button Components for Ionic Apps + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + +The item options component is a container for the [item option](./item-option) buttons in a sliding item. These buttons can be placed either on the [start or end side](#side-description). + +See the [item sliding](./item-sliding) documentation for more information. + +## Side Description + +| Side | Position | Swipe Direction | +| ------- | --------------------------------------------------------------- | ----------------------------------------------------------------- | +| `start` | To the `left` of the content in LTR, and to the `right` in RTL. | From `left` to `right` in LTR, and from `right` to `left` in RTL. | +| `end` | To the `right` of the content in LTR, and to the `left` in RTL. | From `right` to `left` in LTR, and from `left` to `right` in RTL. | + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/item-sliding.md b/versioned_docs/version-v6/api/item-sliding.md new file mode 100644 index 00000000000..62e496d51e8 --- /dev/null +++ b/versioned_docs/version-v6/api/item-sliding.md @@ -0,0 +1,82 @@ +--- +title: 'ion-item-sliding' +--- + +import Props from '@ionic-internal/component-api/v6/item-sliding/props.md'; +import Events from '@ionic-internal/component-api/v6/item-sliding/events.md'; +import Methods from '@ionic-internal/component-api/v6/item-sliding/methods.md'; +import Parts from '@ionic-internal/component-api/v6/item-sliding/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/item-sliding/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/item-sliding/slots.md'; + + + Slide Buttons | Slide Right to Left with ion-item-sliding + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + +A sliding item contains an item that can be dragged to reveal option buttons. It requires an [item](./item) component as a child. All options to reveal should be placed in the [item options](./item-options) element. + +## Basic Usage + +Sliding item options are placed on the `"end"` side of the item by default. This means that options are revealed when the item is swiped from end to start, i.e. from right to left in LTR, but from left to right in RTL. To place them on the opposite side, so that they are revealed when swiping in the opposite direction, set the side attribute to `"start"` on the [item options](./item-options) element. Up to two item options can be used at the same time in order to reveal two different sets of options depending on the swiping direction. + +import Basic from '@site/static/usage/v6/item-sliding/basic/index.md'; + + + +## Icon Options + +When an icon is placed alongside text in the [item option](./item-option), it will display the icon on top of the text by default. The slot on the icon can be changed to any of the available [item option slots](./item-option#slots) to change its position. + +import Icons from '@site/static/usage/v6/item-sliding/icons/index.md'; + + + +## Expandable Options + +Options can be expanded to take up the full width of the item if you swipe past a certain point. This can be combined with the `ionSwipe` event on the [item options](./item-options) to call a method when the item is fully swiped. + +import Expandable from '@site/static/usage/v6/item-sliding/expandable/index.md'; + + + +## Interfaces + +### ItemSlidingCustomEvent + +While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with Ionic events emitted from this component. + +```typescript +interface ItemSlidingCustomEvent extends CustomEvent { + target: HTMLIonItemSlidingElement; +} +``` + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/item.md b/versioned_docs/version-v6/api/item.md new file mode 100644 index 00000000000..cb318d9fb04 --- /dev/null +++ b/versioned_docs/version-v6/api/item.md @@ -0,0 +1,168 @@ +--- +title: 'ion-item' +--- + +import Props from '@ionic-internal/component-api/v6/item/props.md'; +import Events from '@ionic-internal/component-api/v6/item/events.md'; +import Methods from '@ionic-internal/component-api/v6/item/methods.md'; +import Parts from '@ionic-internal/component-api/v6/item/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/item/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/item/slots.md'; + + + ion-item: Input, Edit, or Delete iOS and Android Item Elements + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +Items are elements that can contain text, icons, avatars, images, inputs, and any other native or custom elements. Generally they are placed in a [list](./list) with other items. Items can be swiped, deleted, reordered, edited, and more. + +## Basic Usage + +Items left align text and add an ellipsis when the text is wider than the item. We can modify this behavior using the CSS Utilities provided by Ionic Framework, such as using `.ion-text-wrap` in the below example. See the [CSS Utilities Documentation](/docs/layout/css-utilities) for more classes that can be added to an item to transform the text. + +import Basic from '@site/static/usage/v6/item/basic/index.md'; + + + +## Clickable Items + +An item is considered "clickable" if it has an `href` or `button` property set. Clickable items have a few visual differences that indicate they can be interacted with. For example, a clickable item receives the ripple effect upon activation in `md` mode, has a highlight when activated in `ios` mode, and has a [detail arrow](#detail-arrows) by default in `ios` mode. + +import Clickable from '@site/static/usage/v6/item/clickable/index.md'; + + + +## Detail Arrows + +By default [clickable items](#clickable-items) will display a right arrow icon on `ios` mode. To hide the right arrow icon on clickable elements, set the `detail` property to `false`. To show the right arrow icon on an item that doesn't display it naturally, set the `detail` property to `true`. + +import DetailArrows from '@site/static/usage/v6/item/detail-arrows/index.md'; + + + + + +## Item Lines + +Items show an inset bottom border by default. The border has padding on the left and does not appear under any content that is slotted in the `"start"` slot. The `lines` property can be modified to `"full"` or `"none"` which will show a full width border or no border, respectively. + +import Lines from '@site/static/usage/v6/item/lines/index.md'; + + + +## Media Items + +[Avatars](./avatar) and [Thumbnails](./thumbnail) can be slotted inside of an item. This is useful when making lists of images and text. + +import Media from '@site/static/usage/v6/item/media/index.md'; + + + +## Buttons in Items + +Buttons are styled smaller inside of items than when they are outside of them. To make the button size match buttons outside of an item, set the `size` attribute to `"default"`. + +import Buttons from '@site/static/usage/v6/item/buttons/index.md'; + + + +## Icons in Items + +import Icons from '@site/static/usage/v6/item/icons/index.md'; + + + +## Item Inputs + +import Inputs from '@site/static/usage/v6/item/inputs/index.md'; + + + +## Helper & Error Text + +Helper & error text can be used inside of an item with an input by slotting a note in the `"helper"` and `"error"` slots. The error slot will not be displayed unless the `ion-invalid` class is added to the `ion-item`. In Angular, this is done automatically through form validation. In JavaScript, React and Vue, the class needs to be manually added based on your own validation. + +import HelperError from '@site/static/usage/v6/item/helper-error/index.md'; + + + +## Item Counter + +The item counter is helper text that displays under an input to notify the user of how many characters have been entered out of the total that the input will accept. When adding `counter`, the default behavior is to format the value that gets displayed as `inputLength / maxLength`. This behavior can be customized by passing in a formatter function to the `counterFormatter` property. + +import Counter from '@site/static/usage/v6/item/counter/index.md'; + + + +## Theming + +### Colors + +import Colors from '@site/static/usage/v6/item/theming/colors/index.md'; + + + +### CSS Shadow Parts + +import CSSParts from '@site/static/usage/v6/item/theming/css-shadow-parts/index.md'; + + + +### CSS Custom Properties + +import CSSProps from '@site/static/usage/v6/item/theming/css-properties/index.md'; + + + +### Input Highlight + +Items containing an input will highlight the bottom border of the input with a different color when focused, valid, or invalid. By default, `md` items have a highlight with a height set to `2px` and `ios` has no highlight (technically the height is set to `0`). The height can be changed using the `--highlight-height` CSS property. To turn off the highlight, set this variable to `0`. + +The highlight color changes based on the item state, but all of the states use Ionic colors by default. When focused, the input highlight will use the `primary` color. If the input is valid it will use the `success` color, and invalid inputs will use the `danger` color. This can be customized using the provided CSS properties. + +import InputHighlight from '@site/static/usage/v6/item/theming/input-highlight/index.md'; + + + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/label.md b/versioned_docs/version-v6/api/label.md new file mode 100644 index 00000000000..4b17032fe56 --- /dev/null +++ b/versioned_docs/version-v6/api/label.md @@ -0,0 +1,74 @@ +--- +title: 'ion-label' +--- + +import Props from '@ionic-internal/component-api/v6/label/props.md'; +import Events from '@ionic-internal/component-api/v6/label/events.md'; +import Methods from '@ionic-internal/component-api/v6/label/methods.md'; +import Parts from '@ionic-internal/component-api/v6/label/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/label/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/label/slots.md'; + + + Item Label Color and Properties for Applications | ion-label + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +Label is a wrapper element that can be used in combination with `ion-item`, `ion-input`, `ion-toggle`, and more. The position of the label inside of an item can be inline, fixed, stacked, or floating. + +## Basic Usage + +import Basic from '@site/static/usage/v6/label/basic/index.md'; + + + +## Item Labels + +import Item from '@site/static/usage/v6/label/item/index.md'; + + + +## Input Labels + +import Input from '@site/static/usage/v6/label/input/index.md'; + + + +## Theming + +### Colors + +import Colors from '@site/static/usage/v6/label/theming/colors/index.md'; + + + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/list-header.md b/versioned_docs/version-v6/api/list-header.md new file mode 100644 index 00000000000..bf16332d0fc --- /dev/null +++ b/versioned_docs/version-v6/api/list-header.md @@ -0,0 +1,76 @@ +--- +title: 'ion-list-header' +--- + +import Props from '@ionic-internal/component-api/v6/list-header/props.md'; +import Events from '@ionic-internal/component-api/v6/list-header/events.md'; +import Methods from '@ionic-internal/component-api/v6/list-header/methods.md'; +import Parts from '@ionic-internal/component-api/v6/list-header/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/list-header/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/list-header/slots.md'; + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +List headers are block elements that are used to describe the contents of a [list](./list). Unlike [item dividers](./item-divider), list headers should only be used once at the top of a list of [items](./item). + +## Basic Usage + +import Basic from '@site/static/usage/v6/list-header/basic/index.md'; + + + +## Buttons in List Headers + +A [button](./button) placed in a list header can be useful for showing part of a list and redirecting to the full list with the button. + +import Buttons from '@site/static/usage/v6/list-header/buttons/index.md'; + + + +## List Header Lines + +List headers do not show a bottom border by default. The `lines` property can be modified to `"full"` or `"inset"` which will show a full width border or an inset border with left padding, respectively. + +import Lines from '@site/static/usage/v6/list-header/lines/index.md'; + + + +## Theming + +### Colors + +import Colors from '@site/static/usage/v6/list-header/theming/colors/index.md'; + + + +### CSS Custom Properties + +import CSSProps from '@site/static/usage/v6/list-header/theming/css-properties/index.md'; + + + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/list.md b/versioned_docs/version-v6/api/list.md new file mode 100644 index 00000000000..054686768c7 --- /dev/null +++ b/versioned_docs/version-v6/api/list.md @@ -0,0 +1,71 @@ +--- +title: 'ion-list' +--- + +import Props from '@ionic-internal/component-api/v6/list/props.md'; +import Events from '@ionic-internal/component-api/v6/list/events.md'; +import Methods from '@ionic-internal/component-api/v6/list/methods.md'; +import Parts from '@ionic-internal/component-api/v6/list/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/list/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/list/slots.md'; + + + ion-list: Item List View Component for iOS and Android Apps + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + +Lists are made up of multiple rows of [items](./item) which can contain text, buttons, toggles, +icons, thumbnails, and much more. Lists generally contain items with similar data content, such as images and text. + +Lists support several interactions including swiping items to reveal options, dragging to [reorder](./reorder) items within the list, and deleting items. + +## Basic Usage + +import Basic from '@site/static/usage/v6/list/basic/index.md'; + + + +## Inset List + +Adding the `inset` property to a list will apply margin around the list. In `ios` mode it will also add rounded corners to the list. + +import Inset from '@site/static/usage/v6/list/inset/index.md'; + + + +## List Lines + +Adding the `lines` property to a list will adjust the bottom borders of all of the items in the list. Setting it to `"full"` will display full width borders, `"inset"` will display borders adjusted with left padding, and `"none"` will show no borders. If the `lines` property is set on an item in a list, that will take priority over the property on the list. + +import Lines from '@site/static/usage/v6/list/lines/index.md'; + + + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/loading.md b/versioned_docs/version-v6/api/loading.md new file mode 100644 index 00000000000..2c61ce88c14 --- /dev/null +++ b/versioned_docs/version-v6/api/loading.md @@ -0,0 +1,179 @@ +--- +title: 'ion-loading' +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +import Props from '@ionic-internal/component-api/v6/loading/props.md'; +import Events from '@ionic-internal/component-api/v6/loading/events.md'; +import Methods from '@ionic-internal/component-api/v6/loading/methods.md'; +import Parts from '@ionic-internal/component-api/v6/loading/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/loading/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/loading/slots.md'; + + + Loading | Application Loading Indicator Overlay | ion-loading + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +An overlay that can be used to indicate activity while blocking user interaction. The loading indicator appears on top of the app's content, and can be dismissed by the app to resume user interaction with the app. It includes an optional backdrop, which can be disabled by setting `showBackdrop: false` upon creation. + +## Basic Usage + +Once presented, the loading indicator will display indefinitely by default. Developers can manually dismiss the loading indicator after creation by calling the `dismiss()` method on the component. The `onDidDismiss` function can be called to perform an action after the loading indicator is dismissed. + +Alternatively, developers can configure the loading indicator to dismiss automatically after a specific amount of time by passing the number of milliseconds to display it in the `duration` of the loading options. + +### Controller + +import Controller from '@site/static/usage/v6/loading/controller/index.md'; + + + +### Inline + +Ionic React and Ionic Vue users also have the option to use the `ion-loading` component directly in their template. + + + + +```tsx +import React, { useState } from 'react'; +import { IonLoading, IonButton, IonContent } from '@ionic/react'; + +export const LoadingExample: React.FC = () => { + const [showLoading, setShowLoading] = useState(false); + + return ( + + setShowLoading(true)}>Show Loading + setShowLoading(false)} + message={'Please wait...'} + duration={5000} + /> + + ); +}; +``` + + + + +```html + + + Show Loading + + + + + + +``` + + + + +## Customization + +### Spinners + +The spinner that is used can be customized using the `spinner` property. See the [spinner property documentation](#spinner) for a full list of options. + +import Spinners from '@site/static/usage/v6/loading/spinners/index.md'; + + + +### Theming + +Loading uses scoped encapsulation, which means it will automatically scope its CSS by appending each of the styles with an additional class at runtime. Overriding scoped selectors in CSS requires a [higher specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) selector. + +We recommend passing a custom class and using that to add custom styles to the host and inner elements. + +import Theming from '@site/static/usage/v6/loading/theming/index.md'; + + + +:::note +`ion-loading` is presented at the root of your application, so we recommend placing any `ion-loading` styles in a global stylesheet. +::: + +## Interfaces + +### LoadingOptions + +```typescript +interface LoadingOptions { + spinner?: SpinnerTypes | null; + message?: string | IonicSafeString; + cssClass?: string | string[]; + showBackdrop?: boolean; + duration?: number; + translucent?: boolean; + animated?: boolean; + backdropDismiss?: boolean; + mode?: Mode; + keyboardClose?: boolean; + id?: string; + htmlAttributes?: { [key: string]: any }; + + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; +} +``` + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/menu-button.md b/versioned_docs/version-v6/api/menu-button.md new file mode 100644 index 00000000000..180f59dab48 --- /dev/null +++ b/versioned_docs/version-v6/api/menu-button.md @@ -0,0 +1,50 @@ +--- +title: 'ion-menu-button' +--- + +import Props from '@ionic-internal/component-api/v6/menu-button/props.md'; +import Events from '@ionic-internal/component-api/v6/menu-button/events.md'; +import Methods from '@ionic-internal/component-api/v6/menu-button/methods.md'; +import Parts from '@ionic-internal/component-api/v6/menu-button/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/menu-button/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/menu-button/slots.md'; + + + Menu Button | ion-menu-button to Open an App Menu on A Page + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +The Menu Button component contains an icon and automatically adds functionality to open a menu when clicked. + +See the [menu](./menu) documentation for more information. + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/menu-toggle.md b/versioned_docs/version-v6/api/menu-toggle.md new file mode 100644 index 00000000000..a68507aa4f4 --- /dev/null +++ b/versioned_docs/version-v6/api/menu-toggle.md @@ -0,0 +1,52 @@ +--- +title: 'ion-menu-toggle' +--- + +import Props from '@ionic-internal/component-api/v6/menu-toggle/props.md'; +import Events from '@ionic-internal/component-api/v6/menu-toggle/events.md'; +import Methods from '@ionic-internal/component-api/v6/menu-toggle/methods.md'; +import Parts from '@ionic-internal/component-api/v6/menu-toggle/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/menu-toggle/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/menu-toggle/slots.md'; + + + ion-menu-toggle | MenuToggle Component to Open/Close Active Menus + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +The Menu Toggle component can be used to toggle a menu open or closed. + +Menu toggles are only visible when the selected menu is enabled. If the menu is disabled or it's being presented as a split pane, the menu toggle will be hidden. To always display the menu toggle, the `autoHide` property can be set to `false`. + +See the [menu](./menu#menu-toggle) documentation for more information. + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/menu.md b/versioned_docs/version-v6/api/menu.md new file mode 100644 index 00000000000..e6ba58d6e82 --- /dev/null +++ b/versioned_docs/version-v6/api/menu.md @@ -0,0 +1,96 @@ +--- +title: 'ion-menu' +--- + +import Props from '@ionic-internal/component-api/v6/menu/props.md'; +import Events from '@ionic-internal/component-api/v6/menu/events.md'; +import Methods from '@ionic-internal/component-api/v6/menu/methods.md'; +import Parts from '@ionic-internal/component-api/v6/menu/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/menu/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/menu/slots.md'; + + + ion-menu: API Framework Docs for Types of Menu Components + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +The Menu component is a navigation drawer that slides in from the side of the current view. +By default, it slides in from the left, but the side can be overridden. +The menu will be displayed differently based on the mode, however the display type can be changed to any of the available menu types. +The menu element should be a sibling to the root content element. +There can be any number of menus attached to the content. +These can be controlled from the templates, or programmatically using the MenuController. + +## Basic Usage + +import BasicUsage from '@site/static/usage/v6/menu/basic/index.md'; + + + +## Menu Toggle + +The [ion-menu-toggle](./menu-toggle) component can be used to create custom button that can open or close the menu. + +import MenuToggle from '@site/static/usage/v6/menu/toggle/index.md'; + + + +## Menu Types + +The `type` property can be used to customize how menus display in your application. + +import MenuType from '@site/static/usage/v6/menu/type/index.md'; + + + +## Theming + +### CSS Shadow Parts + +import Theming from '@site/static/usage/v6/menu/theming/index.md'; + + + +## Interfaces + +### MenuCustomEvent + +While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with Ionic events emitted from this component. + +```typescript +interface MenuCustomEvent extends CustomEvent { + detail: T; + target: HTMLIonMenuElement; +} +``` + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/modal.md b/versioned_docs/version-v6/api/modal.md new file mode 100644 index 00000000000..0ad556d9173 --- /dev/null +++ b/versioned_docs/version-v6/api/modal.md @@ -0,0 +1,292 @@ +--- +title: 'ion-modal' +--- + +import Props from '@ionic-internal/component-api/v6/modal/props.md'; +import Events from '@ionic-internal/component-api/v6/modal/events.md'; +import Methods from '@ionic-internal/component-api/v6/modal/methods.md'; +import Parts from '@ionic-internal/component-api/v6/modal/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/modal/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/modal/slots.md'; + + + ion-modal: Ionic Mobile App Custom Modal API Component + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +A Modal is a dialog that appears on top of the app's content, and must be dismissed by the app before interaction can resume. It is useful as a select component when there are a lot of options to choose from, or when filtering items in a list, as well as many other use cases. + +## Inline Modals (Recommended) + +`ion-modal` can be used by writing the component directly in your template. This reduces the number of handlers you need to wire up in order to present the modal. + +When using `ion-modal` with Angular, React, or Vue, the component you pass in will be destroyed when the modal is dismissed. As this functionality is provided by the JavaScript framework, using `ion-modal` without a JavaScript framework will not destroy the component you passed in. If this is a needed functionality, we recommend using the `modalController` instead. + +import InlineModalTriggerExample from '@site/static/usage/v6/modal/inline/basic/index.md'; + + + +### Using `isOpen` + +The `isOpen` property on `ion-modal` allows developers to control the presentation state of the modal from their application state. This means when `isOpen` is set to `true` the modal will be presented and when `isOpen` is set to `false` the modal will be dismissed. + +`isOpen` uses a one-way data binding, meaning it will not automatically be set to `false` when the modal is dismissed. Developers should listen for the `ionModalDidDismiss` or `didDismiss` event and set `isOpen` to `false`. The reason for this is it prevents the internals of `ion-modal` from being tightly coupled with the state of the application. With a one way data binding, the modal only needs to concern itself with the boolean value that the reactive variable provides. With a two way data binding, the modal needs to concern itself with both the boolean value as well as the existence of the reactive variable itself. This can lead to non-deterministic behaviors and make applications harder to debug. + +import InlineModalIsOpenExample from '@site/static/usage/v6/modal/inline/is-open/index.md'; + + + +## Controller Modals + +With the `modalController` developers can present an `ion-modal` programmatically. Developers will have complete control over when a modal is presented and dismissed. + +import ControllerExample from '@site/static/usage/v6/modal/controller/index.md'; + + + +## Preventing a Modal from Dismissing + +When entering data into a modal, it is often desirable to have a way of preventing accidental data loss. The `canDismiss` property on `ion-modal` gives developers control over when a modal is allowed to dismiss. + +There are two different ways of using the `canDismiss` property. + +:::note +Note: When using a sheet modal, `canDismiss` will not be checked on swipe if there is no `0` breakpoint set. However, it will still be checked when pressing `Esc` or the hardware back button. +::: + +### Setting a boolean value + +Developers can set `canDismiss` to a boolean value. If `canDismiss` is `true`, then the modal will close when users attempt to dismiss the modal. If `canDismiss` is `false`, then the modal will not close when users attempt to dismiss the modal. + +Setting a boolean value should be used when you need to require a particular action to be taken prior to a modal being dismissed. For example, if developers want to require that a "Terms of Use" checkbox is checked prior to closing the modal, they could set `canDismiss` to `false` initially and update it to `true` when the checkbox is checked. + +import CanDismissBooleanExample from '@site/static/usage/v6/modal/can-dismiss/boolean/index.md'; + + + +### Setting a callback function + +Developers can set `canDismiss` to be a function. This function must return a `Promise` that resolves to either `true` or `false`. If the promise resolves to `true`, then the modal will dismiss. If the promise resolves to `false`, then the modal will not dismiss. + +Setting a callback function should be used when you have complex dismissing criteria such as showing a confirmation dialog prior to dismissing the modal. The option that users select in this dialog can then be used to determine whether or not the modal should proceed with dismissing. + +Note that setting a callback function will cause the swipe gesture to be interrupted when using a card or sheet modal. This is because Ionic does not know what your callback function will resolve to ahead of time. + +import CanDismissFunctionExample from '@site/static/usage/v6/modal/can-dismiss/function/index.md'; + + + +## Types of modals + +### Card Modal + +Developers can create a card modal effect where the modal appears as a card stacked on top of your app's main content. To create a card modal, developers need to set the `presentingElement` property on `ion-modal`. + +The `presentingElement` property accepts a reference to the element that should display under your modal. This is typically a reference to `ion-router-outlet`. + +The `canDismiss` property can be used to control whether or not the card modal can be swiped to close. + +:::note +The card display style is only available on iOS. +::: + +import CardExample from '@site/static/usage/v6/modal/card/basic/index.md'; + + + +### Sheet Modal + +Developers can create a sheet modal effect similar to the drawer components available in maps applications. To create a sheet modal, developers need to set the `breakpoints` and `initialBreakpoint` properties on `ion-modal`. + +The `breakpoints` property accepts an array which states each breakpoint that the sheet can snap to when swiped. A `breakpoints` property of `[0, 0.5, 1]` would indicate that the sheet can be swiped to show 0% of the modal, 50% of the modal, and 100% of the modal. When the modal is swiped to 0%, the modal will be automatically dismissed. Note that the modal cannot be dismissed on swipe if no `0` breakpoint is included, but it can still be dismissed by pressing `Esc` or the hardware back button. + +The `initialBreakpoint` property is required so that the sheet modal knows which breakpoint to start at when presenting. The `initialBreakpoint` value must also exist in the `breakpoints` array. Given a `breakpoints` value of `[0, 0.5, 1]`, an `initialBreakpoint` value of `0.5` would be valid as `0.5` is in the `breakpoints` array. An `initialBreakpoint` value of `0.25` would not be valid as `0.25` does not exist in the `breakpoints` array. + +The `backdropBreakpoint` property can be used to customize the point at which the `ion-backdrop` will begin to fade in. This is useful when creating interfaces that have content underneath the sheet that should remain interactive. A common use case is a sheet modal that overlays a map where the map is interactive until the sheet is fully expanded. + +import SheetExample from '@site/static/usage/v6/modal/sheet/basic/index.md'; + + + +#### Interacting with background content + +import SheetBackgroundContentExample from '@site/static/usage/v6/modal/sheet/background-content/index.md'; + + + +#### Handle Behavior + +Sheet modals can optionally render a handle indicator used for dragging the sheet between breakpoints. The `handleBehavior` property can be used to configure the behavior of when the handle is activated by the user. + +import SheetHandleBehaviorExample from '@site/static/usage/v6/modal/sheet/handle-behavior/index.md'; + + + +## Styling + +Modals are presented at the root of your application so they overlay your entire app. This behavior applies to both inline modals and modals presented from a controller. As a result, custom modal styles can not be scoped to a particular component as they will not apply to the modal. Instead, styles must be applied globally. For most developers, placing the custom styles in `global.css` is sufficient. + +:::note +If you are building an Ionic Angular app, the styles need to be added to a global stylesheet file. Read [Style Placement](#style-placement) in the Angular section below for more information. +::: + +:::note +`ion-modal` works under the assumption that stacked modals are the same size. As a result, each subsequent modal will have no box shadow and a backdrop opacity of `0`. This is to avoid the effect of shadows and backdrops getting darker with each added modal. This can be changed by setting the `--box-shadow` and `--backdrop-opacity` CSS variables: +::: + +``` +ion-modal.stack-modal { + --box-shadow: 0 28px 48px rgba(0, 0, 0, 0.4); + --backdrop-opacity: var(--ion-backdrop-opacity, 0.32); +} +``` + +import ThemeExample from '@site/static/usage/v6/modal/styling/theming/index.md'; + + + +### Animations + +The enter and leave animations can be customized by using our animation builder and assigning animations to `enterAnimation` and `leaveAnimation`. + +import AnimationsExample from '@site/static/usage/v6/modal/styling/animations/index.md'; + + + +## Custom Dialogs + +While `ion-modal` is most often used for full-page views, cards, or sheets, it is also possible to use it for custom dialogs. This is useful if developers need an interface that is more complex than what components such as [ion-alert](./alert) or [ion-loading](./loading) provide. + +import CustomDialogs from '@site/static/usage/v6/modal/custom-dialogs/index.md'; + + + +A few things to keep in mind when creating custom dialogs: + +- `ion-content` is intended to be used in full-page modals, cards, and sheets. If your custom dialog has a dynamic or unknown size, `ion-content` should not be used. +- Creating custom dialogs provides a way of ejecting from the default modal experience. As a result, custom dialogs should not be used with card or sheet modals. + +## Interfaces + +### ModalOptions + +Below you will find all of the options available to you when using the `modalController`. These options should be supplied when calling `modalController.create()`. + +```typescript +interface ModalOptions { + component: any; + componentProps?: { [key: string]: any }; + presentingElement?: HTMLElement; + showBackdrop?: boolean; + backdropDismiss?: boolean; + cssClass?: string | string[]; + animated?: boolean; + canDismiss?: boolean | (() => Promise); + + mode?: 'ios' | 'md'; + keyboardClose?: boolean; + id?: string; + htmlAttributes?: { [key: string]: any }; + + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; + + breakpoints?: number[]; + initialBreakpoint?: number; + backdropBreakpoint?: number; + handle?: boolean; +} +``` + +### ModalCustomEvent + +While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with Ionic events emitted from this component. + +```typescript +interface ModalCustomEvent extends CustomEvent { + target: HTMLIonModalElement; +} +``` + +## Accessibility + +### Keyboard Navigation + +| Key | Function | +| ----- | ------------------- | +| `Esc` | Dismisses the modal | + +### Labels + +Modals have a [`dialog`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role) role. As a result, developers **must** properly label their modals. If the modal is using `ion-title`, the text inside can be used to label the modal itself by setting [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby) on `ion-modal`. If the modal contains additional descriptive text, this text can be associated with the modal by using [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby). + +### Screen Readers + +Modals have the `aria-modal` attribute applied. This attribute can cause assistive technologies to limit navigation to the modal element's contents. As a result, using gestures that move to the next or previous items may not focus elements outside of the modal. This applies even when the backdrop is disabled in sheet modals using the `backdropBreakpoint` property. + +Assistive technologies will not limit navigation to the modal element's contents if developers manually move focus. However, manually moving focus outside of a modal is not supported in Ionic for modals that have focus trapping enabled. + +See https://w3c.github.io/aria/#aria-modal for more information. + +### Focus Trapping + +When a modal is presented, focus will be trapped inside of the presented modal. Users can focus other interactive elements inside the modal but will never be able to focus interactive elements outside the modal while the modal is presented. For applications that present multiple stacked modals, focus will be trapped on the modal that was presented last. + +Sheet modals that have had their backdrop disabled by the `backdropBreakpoint` property are not subject to focus trapping. + +### Sheet Modals + +Sheet modals allow users to interact with content behind the modal when the `backdropBreakpoint` property is used. The backdrop will be disabled up to and including the specified `backdropBreakpoint` and will be enabled after it. + +When the backdrop is disabled, users will be able to interact with elements outside the sheet modal using a pointer or keyboard. Assistive technologies may not focus outside the sheet modal by default due to the usage of `aria-modal`. We recommend avoiding features such as autofocus here as it can cause assistive technologies to jump between two interactive contexts without warning the user. + +## Performance + +### Mounting Inner Contents + +The content of an inline `ion-modal` is unmounted when closed. If this content is expensive to render, developers can use the `keepContentsMounted` property to mount the content as soon as the modal is mounted. This can help optimize the responsiveness of your application as the inner contents will have already been mounted when the modal opens. + +import Mount from '@site/static/usage/v6/modal/performance/mount/index.md'; + + + +Developers should keep the following in mind when using `keepContentsMounted`: + +- This feature should be used as a last resort in order to deal with existing performance problems. Try to identify and resolve performance bottlenecks before using this feature. Additionally, do not use this to anticipate performance problems. + +- This feature is only needed when using a JavaScript Framework. Developers not using a framework can pass the contents to be rendered into the modal, and the contents will be rendered automatically. + +- This feature only works with inline modals. Modals created with the `modalController` are not created ahead of time, so the inner contents are not created either. + +- Any JavaScript Framework lifecycle hooks on the inner component will run as soon as the modal is mounted, not when the modal is presented. + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/nav-link.md b/versioned_docs/version-v6/api/nav-link.md new file mode 100644 index 00000000000..8d5857465dc --- /dev/null +++ b/versioned_docs/version-v6/api/nav-link.md @@ -0,0 +1,50 @@ +--- +title: 'ion-nav-link' +--- + +import Props from '@ionic-internal/component-api/v6/nav-link/props.md'; +import Events from '@ionic-internal/component-api/v6/nav-link/events.md'; +import Methods from '@ionic-internal/component-api/v6/nav-link/methods.md'; +import Parts from '@ionic-internal/component-api/v6/nav-link/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/nav-link/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/nav-link/slots.md'; + + + ion-nav-link: The Element for Navigation to a Specified Component + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + +A navigation link is used to navigate to a specified component. The component can be navigated to by going `forward`, `back` or as a `root` component. + +It is the element form of calling the `push()`, `pop()`, and `setRoot()` methods on the navigation controller. + +See the [nav](./nav#using-navlink) documentation for more information. + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/nav.md b/versioned_docs/version-v6/api/nav.md new file mode 100644 index 00000000000..330f38561c4 --- /dev/null +++ b/versioned_docs/version-v6/api/nav.md @@ -0,0 +1,70 @@ +--- +title: 'ion-nav' +--- + +import Props from '@ionic-internal/component-api/v6/nav/props.md'; +import Events from '@ionic-internal/component-api/v6/nav/events.md'; +import Methods from '@ionic-internal/component-api/v6/nav/methods.md'; +import Parts from '@ionic-internal/component-api/v6/nav/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/nav/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/nav/slots.md'; + + + ion-nav | Nav View Component for Ionic Framework Apps + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +Nav is a standalone component for loading arbitrary components and pushing new components on to the stack. + +Unlike Router Outlet, Nav is not tied to a particular router. This means that if we load a Nav component, and push other components to the stack, they will not affect the app's overall router. This fits use cases where you could have a modal, which needs its own sub-navigation, without making it tied to the apps URL. + +## Using NavLink + +NavLink is a simplified API when interacting with Nav. Developers can customize the component, pass along component properties, modify the direction of the route animation or define a custom animation when navigating. + +import NavLinkExample from '@site/static/usage/v6/nav/nav-link/index.md'; + + + +## Interfaces + +### NavCustomEvent + +While not required, this interface can be used in place of the `CustomEvent` interface for stronger typing with Ionic events emitted from this component. + +```typescript +interface NavCustomEvent extends CustomEvent { + target: HTMLIonNavElement; +} +``` + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/note.md b/versioned_docs/version-v6/api/note.md new file mode 100644 index 00000000000..fd8cbc92fdf --- /dev/null +++ b/versioned_docs/version-v6/api/note.md @@ -0,0 +1,74 @@ +--- +title: 'ion-note' +--- + +import Props from '@ionic-internal/component-api/v6/note/props.md'; +import Events from '@ionic-internal/component-api/v6/note/events.md'; +import Methods from '@ionic-internal/component-api/v6/note/methods.md'; +import Parts from '@ionic-internal/component-api/v6/note/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/note/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/note/slots.md'; + + + ion-note: Note Text Elements for iOS and Android Ionic Apps + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +Notes are text elements generally used as subtitles that provide more information. They are styled to appear grey by default. Notes can be used in an item as metadata text. + +## Basic Usage + +import Basic from '@site/static/usage/v6/note/basic/index.md'; + + + +## Item Notes + +import Item from '@site/static/usage/v6/note/item/index.md'; + + + +## Theming + +### Colors + +import Colors from '@site/static/usage/v6/note/theming/colors/index.md'; + + + +### CSS Custom Properties + +import CSSProps from '@site/static/usage/v6/note/theming/css-properties/index.md'; + + + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/picker.md b/versioned_docs/version-v6/api/picker.md new file mode 100644 index 00000000000..1c3ab46eab4 --- /dev/null +++ b/versioned_docs/version-v6/api/picker.md @@ -0,0 +1,130 @@ +--- +title: 'ion-picker' +--- + +import Props from '@ionic-internal/component-api/v6/picker/props.md'; +import Events from '@ionic-internal/component-api/v6/picker/events.md'; +import Methods from '@ionic-internal/component-api/v6/picker/methods.md'; +import Parts from '@ionic-internal/component-api/v6/picker/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/picker/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/picker/slots.md'; + + + Picker | Display Buttons and Columns for ion-picker on Ionic Apps + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +A Picker is a dialog that displays a row of buttons and columns underneath. It appears on top of the app's content, and at the bottom of the viewport. + +## Single Column + +Display a list of options in a single, scrollable column. + +import SingleColumn from '@site/static/usage/v6/picker/single-column/index.md'; + + + +## Multiple Columns + +Display multiple columns of different options. + +import MultipleColumn from '@site/static/usage/v6/picker/multiple-column/index.md'; + + + +## Interfaces + +### PickerButton + +```typescript +interface PickerButton { + text?: string; + role?: string; + cssClass?: string | string[]; + handler?: (value: any) => boolean | void; +} +``` + +### PickerColumn + +```typescript +interface PickerColumn { + name: string; + align?: string; + selectedIndex?: number; + prevSelected?: number; + prefix?: string; + suffix?: string; + options: PickerColumnOption[]; + cssClass?: string | string[]; + columnWidth?: string; + prefixWidth?: string; + suffixWidth?: string; + optionsWidth?: string; +} +``` + +### PickerColumnOption + +```typescript +interface PickerColumnOption { + text?: string; + value?: any; + disabled?: boolean; + duration?: number; + transform?: string; + selected?: boolean; +} +``` + +### PickerOptions + +```typescript +interface PickerOptions { + columns: PickerColumn[]; + buttons?: PickerButton[]; + cssClass?: string | string[]; + showBackdrop?: boolean; + backdropDismiss?: boolean; + animated?: boolean; + + mode?: Mode; + keyboardClose?: boolean; + id?: string; + htmlAttributes?: { [key: string]: any }; + + enterAnimation?: AnimationBuilder; + leaveAnimation?: AnimationBuilder; +} +``` + +## Properties + + + +## Events + + + +## Methods + + + +## CSS Shadow Parts + + + +## CSS Custom Properties + + + +## Slots + + diff --git a/versioned_docs/version-v6/api/popover.md b/versioned_docs/version-v6/api/popover.md new file mode 100644 index 00000000000..041db143901 --- /dev/null +++ b/versioned_docs/version-v6/api/popover.md @@ -0,0 +1,262 @@ +--- +title: 'ion-popover' +--- + +import Props from '@ionic-internal/component-api/v6/popover/props.md'; +import Events from '@ionic-internal/component-api/v6/popover/events.md'; +import Methods from '@ionic-internal/component-api/v6/popover/methods.md'; +import Parts from '@ionic-internal/component-api/v6/popover/parts.md'; +import CustomProps from '@ionic-internal/component-api/v6/popover/custom-props.md'; +import Slots from '@ionic-internal/component-api/v6/popover/slots.md'; + + + ion-popover: iOS / Android Popover UI Component & CSS Properties + + + +import EncapsulationPill from '@components/page/api/EncapsulationPill'; + + + +A Popover is a dialog that appears on top of the current page. It can be used for anything, but generally it is used for overflow actions that don't fit in the navigation bar. + +There are two ways to use `ion-popover`: inline or via the `popoverController`. Each method comes with different considerations, so be sure to use the approach that best fits your use case. + +## Inline Popovers + +`ion-popover` can be used by writing the component directly in your template. This reduces the number of handlers you need to wire up in order to present the popover. + +When using `ion-popover` with Angular, React, or Vue, the component you pass in will be destroyed when the popover is dismissed. As this functionality is provided by the JavaScript framework, using `ion-popover` without a JavaScript framework will not destroy the component you passed in. If this is a needed functionality, we recommend using the `popoverController` instead. + +### When to use + +Using a popover inline is useful when you do not want to explicitly wire up click events to open the popover. For example, you can use the `trigger` property to designate a button that should present the popover when clicked. You can also use the `trigger-action` property to customize whether the popover should be presented when the trigger is left clicked, right clicked, or hovered over. + +If you need fine grained control over when the popover is presented and dismissed, we recommend you use the `popoverController`. + +### Angular + +Since the component you passed in needs to be created when the popover is presented and destroyed when the popover is dismissed, we are unable to project the content using `` internally. Instead, we use `` which expects an `` to be passed in. As a result, when passing in your component you will need to wrap it in an ``: + +```html +