BY Simmi Kava29 Sep 2021 Edit
WebAtoms: AtomExpander - Expandable Container to host content

WebAtoms: AtomExpander - User Interface Control


What is AtomExpander?

This control is an expandable container to host any content. It contains a header and expandable content part which allows content toggling by clicking on the header.

What are the properites of AtomExpander?

  • AtomExpander.detail
  • AtomExpander.detailTemplate
  • AtomExpander.icon

What is the difference between "AtomExpander.detail" and "AtomExpander.detailTemplate"?

In AtomExpander.detail the element already exists during the runtime whereas in AtomExpander.detailTemplate the element is created when the header text is clicked.

What is the purpose of AtomExpander.icon?

This is a bindable property which can be used to add an icon to the header text. For e.g. you can integrate it with FontAwesome icons.

WebAtoms now provides AtomExpander as the control for Xamarin.Forms. Let us learn the how to use the control through an example.

AtomExpander Code Sample

The demo example displays various controls WebAtoms offers and explains how to use the AtomExpander control and its important properties. In this example we are explaining what controls does WebAtoms offer and one liner description of each of the controls. The sample also explain how to integrate the Font Awesome icon with the header (or the expandable) text.

Let's learn how to design the content page / layout for AtomExpander.

Content Page Design

<WA.AtomExpander 
    padding={5}
    backgroundColor={XF.Color.white}
    horizontalOptions="FillAndExpand"
    >
    <WA.AtomExpander.icon>
        <XF.FontImageSource
            fontFamily={FontAwesomeSolid}
            glyph={FontAwesomeSolid.tags}
            color={XF.Color.orangeRed}
        />
    </WA.AtomExpander.icon>
    <XF.Label
    fontSize="20"
    text="AtomChips"
    />  
    <WA.AtomExpander.detail>
        <XF.Label
            text="This control is a material design dynamic element 
            which can be used as input, or to select and filter 
            content or to trigger an action."
        />       
    </WA.AtomExpander.detail>
</WA.AtomExpander>

For the complete sample, you may refer the demo link.

We do not need a ViewModel for this example. But we might need a ViewModel for some other requirement. For e.g. after the control is expanded you want to show certain items and when the control is collapsed you want to hide certain set of items.

XF-Controls version being used is 2.0.47.

Demo Link

BY Simmi Kava
LikeCommentSave
LikeCommentSaveShare
0
Categories
General
YantraJS
Developer Guides
Tutorials
Web Atoms Updates

POPULAR POSTS
17 Mar 2021
LATEST ACTIVITY
Simmi Kava
commented this post.
Simmi Kava
liked this post.
Show more
ARCHIVES
2024
2023
2022
2021
TAGS
javascript (56)
developer (25)
javascriptdeveloper (16)
Xamarin.Forms (16)
Html (14)
typescript (12)
webatoms (12)
xamarin (11)
coding (10)
web-atoms (10)
arrays (9)
android (8)
javascript-developer (8)
csharp (7)
dotnet (7)
css (6)
update (6)
dotnet-standard (5)
function (5)
iOS (5)
methods (4)




Web Atoms: JSX (TSX + TypeScript) for Xamarin.Forms, Hot Reload Your App in Production Environment

PlaygroundSamples Repository