1. Ui Package
  2. 🛠️ Component Overview

Ui Package

🛠️ Component Overview

TypeScript NPM Version Repo Bitbucket Bitbucket open pull requests NPM License

Welcome to the Component Overview page! Here, you'll find detailed descriptions of the various UI components available in this package. These components are designed to enhance your application's user interface by providing consistent and reusable building blocks.

Available Components

This package includes five main types of components:

  • Placeholders: For displaying loading states or empty content.
  • Navigation: To assist with user navigation within the application.
  • Loading States: To indicate ongoing processes.
  • Error States: To handle and display error messages.
  • Aggregate Displays: For showing summarized data.

Placeholder Components

CardHorizontalPlaceholder

Repo Bitbucket

The <CardHorizontalPlaceholder /> component renders a skeleton card, which serves as a visual placeholder while content is loading. It does not accept any properties.

Repo Bitbucket

CardViewPlaceholder

Repo Bitbucket

The <CardViewPlaceholder /> component is built using the <CardHorizontalPlaceholder /> to create a grid view layout. It accepts a count property to determine how many placeholders to display.

It has the following properties:

Name Type Description
count
number
Number of CardHorizontalPlaceholder will be displayed
col
number
Number of column in the grid layout
          <script lang="ts">
    import { CardViewPlaceholder } from '@tanglemedia/svelte-starter-ui';
  </script>
  <CardViewPlaceholder count={2} />

      
Repo Bitbucket

DetailsPlaceholder

Repo Bitbucket

Using the <TextPlaceholder /> from Flowbite-Svelte, the <DetailsPlaceholder /> creates a vertical list view placeholder. It also accepts a count property.

It has the following properties:

Name Type Description
count
number
Number of TextPlaceholder will be displayed
          <script lang="ts">
    import { DetailsPlaceholder } from '@tanglemedia/svelte-starter-ui';
  </script>
  <DetailsPlaceholder count={2} />

      
Loading...
Loading...
Repo Bitbucket

ListViewPlaceholder

Repo Bitbucket

The <ListViewPlaceholder /> component uses skeleton shapes to represent a vertical list. It accepts a count property similar to the other placeholders.

It has the following properties:

Name Type Description
count
number
Number of items will be displayed on the table
          <script lang="ts">
    import { ListViewPlaceholder } from '@tanglemedia/svelte-starter-ui';
  </script>
  <ListViewPlaceholder count={2} />

      
Repo Bitbucket

GeneralListViewPlaceholder

Repo Bitbucket

Combining both the <ListViewPlaceholder /> and <CardViewPlaceholder />, the <GeneralListViewPlaceholder /> provides a flexible list view component. It accepts a viewType property along with count.

It has the following properties:

Name Type Description
count
number
Number of CardHorizontalPlaceholder will be displayed
viewType
number
0 is a CardViewPlaceholder components, 1 is a ListViewPlaceholder components
          <script lang="ts">
    import { GeneralListViewPlaceholder } from '@tanglemedia/svelte-starter-ui';
  </script>
  <ListViewPlaceholder count={2} viewType={0} />

      
Repo Bitbucket
          <script lang="ts">
    import { GeneralListViewPlaceholder } from '@tanglemedia/svelte-starter-ui';
  </script>
  <ListViewPlaceholder count={2} viewType={1} />

      
Repo Bitbucket

BackArrow

Repo Bitbucket

The <BackArrow /> component facilitates navigation by allowing users to return to the previous page in their browsing history. You can also specify a custom route for redirection.

It has the following properties:

Name Type Description
backUrl
string | void function
This is the url/function that your back button will redirect the user to, if nothing is passed it will use the history api.
buttonBackgroundColor
string
Number of column in the grid layout
iconSize
string
Size of the icon in the button, default is 2rem
          <script lang="ts">
    import { BackArrow } from '@tanglemedia/svelte-starter-ui';
  </script>
  <BackArrow />

      
Repo Bitbucket

Loading Components

PageLoader

Repo Bitbucket

The <PageLoader /> component is used to indicate that a page is currently loading. It can be customized with a title, description, and slots.

It has the following properties:

Name Type Description
title
string
This is the title text the PageLoader component will display.
description
string
This is the description text the PageLoader component will display.
spinner
slot
This is a slot that will replace the spinner component area.
information
slot
This is a slot that will replace the title and the description area.
          <script lang="ts">
    import { PageLoader } from '@tanglemedia/svelte-starter-ui';
  </script>
  <PageLoader />

      

Loading

This may take a few seconds, please don't close this page.

Repo Bitbucket

Lazy

Repo Bitbucket

Error Component

PageNotFoundCard

Repo Bitbucket

The <PageNotFoundCard /> component displays an error message, typically a 404 error. It can be customized to show different types of errors.

It has the following properties:

Name Type Description
displaySvg
boolean
This is responsible to display or not the svg image.
svgImage
string
This is the svg image url that will be placed in a image tag.
iconClass
string
This variable controls the classes of the default icon/svgImage.
buttonClass
string
This variable controls the classes of the action button.
imageClass
string
This variable controls the classes of the svgImage.
errorCodeClass
string
This variable controls the classes of the h1 element that displays the error code.
headerClass
string
This variable controls the classes of the h2 element that displays the header text.
paragraphClass
string
This variable controls the classes of the paragraph element that displays the extra information text.
errorCode
string
This is the error code that gets displayed in the screen, default is 404.
headerText
string
This is the header text, i.e. the name of the type of error, that gets displayed in the screen, default is Page Not Found.
paragraphText
string
This is the description of the error that gets displayed in the screen, default is The page you are looking for doesnt exist.
buttonText
string
This is the title of the action button, default is Back to homepage.
href
string
This is the link the user gets redirected to when the action button is clicked, default is /.
          <script lang="ts">
    import { PageNotFoundCard } from '@tanglemedia/svelte-starter-ui';
  </script>
  <PageNotFoundCard />

      

404

Page not found

The page you are looking for doesn't exist

Back to homepage
Repo Bitbucket

Aggregate Component

AggregateStub

Repo Bitbucket

The <AggregateStub /> component presents an aggregate value alongside an icon. It can also function as a button and accepts properties for the label and metric.

It has the following properties:

Name Type Description
bgColor
string
This is responsible to change the background color of the component, it is bg-white by default.
textColor
string
This is responsible to change the icon color of the component, it is text-black by default.
metric
string
This is responsible to display the aggregate metric value on the component, it is undefined by default.
label
string
This is responsible to display the label/description of the metric on the component, it is undefined by default.
href
string
This is responsible to make the component into a button and redirect the user to the href, it is null by default.
iconType
string
This is responsible to display the type of FontAwesome icon on the component, i.e. fas, far, fal, fad, fat, it is empty string by default.
iconName
string
This is responsible to display the name of FontAwesome icon on the component, i.e. cube, lock, user, etc..., it is empty string by default.
iconSize
string
This is responsible to display the size of FontAwesome icon on the component, i.e. xs, sm, md, lg, xl, 2x ..., it is 2x by default.
          <script lang="ts">
    import { AggregateStub } from '@tanglemedia/svelte-starter-ui';
  </script>
  <AggregateStub label="Number of downloads" metric="20" />

      

20

Number of downloads
Repo Bitbucket