The html tag it is supposed to represent.
HTMl attributes in the form of key value pairs.
An array of Component
which would be rendered as
child elements of the current element
The CSS classes and their properties.
URL to an external source file.
Type of the CSS attachment. Either inline or external. Note: inline attachments are supported under Attributes, and Style functions under Component.
Get the attributes of the component
Object containing all the attributes of the component
var myComponent = new Component("div",{"id":"my-component"});
var attributes = myComponent.getAttributes(); // a div component
console.log(attributes); // {"id":"my-component"};
Sets or Creates a new attribute on the component
var myComponent = new Component("p");
myComponent.setAttribute("class", "my-component para lg:mx-5 sm:mx-1");
myComponent.setAttribute("id","my-unique-id");
nmae of the attribute to set
the value of the attribute to set
Add a new child to the component
var component1 = new Component("div"); // parent component
var component2 = new Component("p"); // child component
component1.addChild(component2);
Use addChildren
instead
Add a child to the component. Child can be of any level of inheritance of component.
Add multiple children to the component
var component1 = new Component("div"); // parent component
var component2 = new Component("p"); // child component
component1.addChildren(component2);
Rest
...childrenToAdd: Component[]A destructured list of components to add as children
Add multiple classes to the list of classes
var myComponent = new Component("div");
myComponent.addClasses("mx-5"); // class = "mx-5"
myComponent.addClasses("my-1"); // class = "my-1" "mx-5"
Rest
...classNames: string[]the destructured string array of class names to add to the component
Adds a new CSS class with the specified properties.
The name of the CSS class to add.
The properties to associate with the new CSS class.
Updates the properties of an existing CSS class.
The name of the CSS class to update.
The updated properties to associate with the CSS class.
Adds the given properties to the specified class. If the class does not exist, it will be created.
The name of the class to add properties to.
An object containing the properties to add, where the key is the property name and the value is the property value.
Removes the given properties from the specified class. If the class no longer has any properties, it will be removed.
The name of the class to remove properties from.
An object containing the properties to remove, where the key is the property name and the value is the property value.
Updates the given properties of the specified class. If the class does not exist, it will be created.
The name of the class to update properties of.
An object containing the properties to update, where the key is the property name and the value is the property value.
Gets the properties of an existing CSS class.
The properties of the specified CSS class, or undefined if the CSS class does not exist.
The name of the CSS class to get the properties of.
Style
A representation of Style tag.
Author
Ansh Sharma
TODO:
build/[name]/style/
folder.