Skip to main content

Components

Components and their respective properties

KhatraPlaceholder

KhatraPlaceholder is the base container to hold your content, maintain your loading state of your content , place custom placeholders and change animations.

<KhatraPlaceholder>YourContent</KhatraPlaceholder>
PropertyTypeRequiredDefault valueDescription
isLoadingBooleannofalsestate to either hide or show content
delayNumberno0to add delay in between changing state from loading to loaded.(Use to omit fast flicker in faster network devices.)
customPlaceholderReact Componentnonullplaceholder to show when content is loading
typeStringnonulltype of builtin placeholders provided by the library either of "ListMediaPlaceholder","ProductPlaceholder","ImagePlaceholder","ParagraphPlaceholder"
animateWaveBooleannonullto trigger shrimmer animation on placeholders
animateGlowBooleannonullto trigger glow animation on placeholders
styleObjectnonullfor custom css styling
classNameStringnonullfor custom css class names

PCardContainer

PCardContainer is container to hold one or more.

<PCardContainer>{...children}<PCardContainer>
PropertyTypeRequiredDefault valueDescription
classNameStringnonullfor custom css class names

PCard

PCard is base container for creating card placeholders.
Only place to control animations, either animateWave or animateGlow.

<PCard>{...children}</PCard>
PropertyTypeRequiredDefault valueDescription
wStringyesnullwidth of PCard
hStringyesnullheight of PCard
brStringno"0.75rem"borderRadius of PCard
gapStringnonullgap between children
animateWaveBooleannonullto trigger shrimmer animation on childrens
animateGlowBooleannonullto trigger glow animation on childrens
styleObjectnonullfor custom css styling
classNameStringnonullfor custom css class names
Note

Note: using both animateWave and animateGlow stops animation.

PBlock

PBlock is used for creating placeholders for titles, images and badges.

<PBlock />
PropertyTypeRequiredDefault valueDescription
wStringno"100%"width of PBlock
hStringno"100%"height of PBlock
brStringno"0.75rem"borderRadius of PBlock
alignStringnonullto align-self inside PCard, takes either of values flex-start,flex-end & center
roundedBooleannonullto create cicles
styleObjectnonullfor custom css styling
classNameStringnonullfor custom css class names

PInlineContainer

PInlineContainer is parent container to hold PLine component. Without PInlineContainer, PLine cannot be rendered.

<PInlineContainer>{...children}</PInlineContainer>
PropertyTypeRequiredDefault valueDescription
wStringno"100%"width of PInlineContainer
hStringno"fit-content"height of PInlineContainer
brStringno"5px"borderRadius for each children
gapStringno"0.5rem"gap between chilrens PInlineContainer
justifyStringnonullto justify PLines,PBlock inside PInlineContainer takes either of space-between, space-around, space-evenly & centerr
rowsNumbernonullto create given number of rows of PLines
rowsWidthStringnonullto specify width for given number of 'rows'
rowsHeightStringnonullto specify height for given number of 'rows'
styleObjectnonullfor custom css styling
classNameStringnonullfor custom css class names

PLine

PLine is used to create placeholders for texts. Used with parent PInLineContainer

<PLine />
PropertyTypeRequiredDefault valueDescription
wStringno"100%"width of PLine
hStringno"1rem"height of PLine
brStringnonullborderRadius
alignStringnonullto align-self inside PInlineContainer, takes either of values flex-start,flex-end & center
styleObjectnonullfor custom css styling
classNameStringnonullfor custom css class names