Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

anchor-ui

Package Overview
Dependencies
Maintainers
2
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchor-ui

React Component UI Kit

  • 1.10.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
decreased by-3.45%
Maintainers
2
Weekly downloads
 
Created
Source

Anchor UI

UI kit for chat engines with React

Usage

Install from npm

NPM

Components

withTheme higherOrderComponent for providing theme color context

Usage:

export default withTheme(YourComponent, '#1ba6c4');

Arguments:

NameTypeRequiredDefaultDescription
ChildComponentComponentYesChild component to render
colorStringYesTheme color

<Alert /> used for rendering an alert.

Props:

NameTypeRequiredDefaultDescription
textNodeYesText to display
typeStringYesType of alert, either of the following: 'success', 'error', 'warning', 'info'
hideAlertFunctionYes{}Function to hide the alert
styleObjectNo{}Override the styles of the root element
textStyleObjectNo{}Override the styles of the text element
iconStyleObjectNo{}Override the styles of the icon element
buttonStyleObjectNo{}Override the styles of the button element


<Avatar /> used for rendering a user's profile image.

Props:

NameTypeRequiredDefaultDescription
imageStringYesPath to user's profile image
styleObjectNo{}Override the styles of the root element

<AppHeader /> the app's header.

Props:

NameTypeRequiredDefaultDescription
textNodeYesTitle text (your app's name)
iconNodeNonullIcon (your app's logo)
rightButtonNodeNonullA button for the right side of the input
styleObjectNo{}Override the styles of the root element
textStyleObjectNo{}Override the styles of the root element
iconStyleObjectNo{}Override the styles of the root element

<Badge /> used for notification counter.

Props:

NameTypeRequiredDefaultDescription
valueNumberYesContent to be rendered
maxValueNumberYesThe badge's max value, will display ${maxValue}+ if this value is exceeded
styleObjectNo{}Override the styles of the root element

<Button />

Props:

NameTypeRequiredDefaultDescription
childrenNodeYesButton content
iconButtonBooleanNofalseSwitches between icon-button and normal button
onClickFunctionYesButton onClick function
styleObjectNo{}Override the styles of the root element

<ChannelHeader /> a channel's header containing the channel name

Props:

NameTypeRequiredDefaultDescription
nameNodeYesHeader content
styleObjectNo{}Override the styles of the root element
headerTextStyleObjectNo{}Override the styles of the text element
leftButtonNodeNoA button for the left side of the header
leftButtonStyleNodeNo{}Override the styles of the leftButton element
rightButtonNodeNoA button for the right side of the header
rightButtonStyleNodeNo{}Override the styles of the rightButton element

<EmptyState /> used for empty states

Props:

NameTypeRequiredDefaultDescription
headerTextNodeYesHeader text
bodyTextNodeYesBody text
buttonNodeNo{}Render a call to action button
styleObjectNo{}Override the styles of the root element
headerStyleObjectNo{}Override the styles of the header text
bodyStyleObjectNo{}Override the styles of the body text

<List />

Props:

NameTypeRequiredDefaultDescription
childrenNodeYesList content
listRefFunctionNoRef function to the
    styleObjectNo{}Override the styles of the root element

    <ListItem />

    Props:

    NameTypeRequiredDefaultDescription
    primaryTextNodeYesThe list item's primary text
    secondaryTextNodeYesThe list item's secondary text
    activeBooleanNofalseAdd active styles to ListItem
    onClickFunctionYesClick function for the root element
    styleObjectNo{}Override the styles of the root element
    primaryTextStyleObjectNo{}Override the styles of the primaryText element
    secondaryTextStyleObjectNo{}Override the styles of the secondaryText element

    <Loader /> Loading dots component

    Props:

    NameTypeRequiredDefaultDescription
    styleObjectNo{}Override the styles of the root element
    dotStyleObjectNo{}Override the styles of the dot element

    <Message />

    Props:

    NameTypeRequiredDefaultDescription
    messageObjectYesMesage object containing: body, createdAt, username
    message.bodyStringYesThe message's body text
    message.createdAtString, DateYesTime when the message was created
    message.usernameStringYesThe sender's username
    timeFormatStringNo'HH:mm'The format in which to display message.createdAt
    avatarStringNo''Path to the user's profile image, will render if supplied
    myMessageBooleanNofalseFlag used to change message styles, set to true if the message belongs to the current user
    styleObjectNo{}Override the styles of the root element
    messageBodyStyleObjectNo{}Override the styles of the body element
    messageHeaderStyleObjectNo{}Override the styles of the header element
    messageTimeStyleObjectNo{}Override the styles of the time element
    emojiBooleanNofalseEnable emojione for messages

    <MessageInput /> text input for message

    Props:

    NameTypeRequiredDefaultDescription
    valueStringYesThe input's value
    placeholderStringYesThe input's placeholder
    onChangeFunctionYesChange the input's value
    sendMessageFunctionYesSend a message
    styleObjectNo{}Override the styles of the root element
    inputStyleObjectNo{}Override the styles of the input element
    maxLengthNumberNo500The input's max length
    leftButtonNodeNonullA button for the left side of the input
    inputRefFunctionNoRef function to the element

    <ProfileCard /> used for rendering a user's profile details.

    Props:

    NameTypeRequiredDefaultDescription
    usernameNodeYesThe user's username
    avatarStringYesPath to the user's profile image, will render if supplied
    styleObjectNo{}Override the styles of the root element

    <Input /> general input for forms

    Props:

    NameTypeRequiredDefaultDescription
    valueStringYesThe input's value
    labelStringYesThe input's label
    onChangeFunctionYesChange the input's value
    styleObjectNo{}Override the styles of the root element
    inputStyleObjectNo{}Override the styles of the input element
    labelStyleObjectNo{}Override the styles of the label element
    maxLengthNumberNo500The input's max length
    inputRefFunctionNoRef function to the element

    Installation

    src

    Install node_modules used in ./src:

    $ npm i
    

    Compile ./src with Babel:

    $ npm run compile
    

    examples

    Install node_modules used in ./examples:

    $ cd examples && npm i
    

    Development

    src

    To watch for changes in ./src run:

    $ npm run watch
    

    Babel will compile ./src on changes.

    examples

    To start the webpack server run:

    $ cd examples && npm run start
    

    Webpack wil compile on changes in ./examples/src.

    License

    This project is licensed under the terms of the MIT license.

    Keywords

    FAQs

    Package last updated on 07 Feb 2017

    Did you know?

    Socket

    Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

    Install

    Related posts

    SocketSocket SOC 2 Logo

    Product

    • Package Alerts
    • Integrations
    • Docs
    • Pricing
    • FAQ
    • Roadmap
    • Changelog

    Packages

    npm

    Stay in touch

    Get open source security insights delivered straight into your inbox.


    • Terms
    • Privacy
    • Security

    Made with ⚡️ by Socket Inc