This component allows other components to be grouped together. It performs the function of an HTML <div>. This is your basic tool for constructing complex user interfaces out of simpler ones.
Parameters
- items: ZUI[] | ()=>ZUI[] – this is either a list of ZUI components are a function that will return a list of ZUI components. The function will be called each time this component is rendered and is useful for dynamically modifying the set of components in the list.
Attributes
Only those inherited from ZUI
Examples
new DivUI([ new TextUI("Name"), new TextUI(()=>{ return name from the data }), new ButtonUI("Delete").click(()=>{ code to delete the data }) ]); new DivUI(()=>{ let nameList:string[] = list of names from the data; let zuiList:ZUI[] = []; for (let i in nameList){ let nameZUI = new TextUI(nameList[i]); zuiList.push(nameZUI); } return zuiList; })
In the second example the code retrieves a list of names from the data and builds a TextUI component from each name. These are all added to the list returned by the function. This allows the list of elements in the DivUI to dynamically change as the number of names in the list changes.
Styling
- DivUI – this is the default style class.