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

@rei/cdr-list

Package Overview
Dependencies
Maintainers
9
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rei/cdr-list

REI Cedar Style Framework - Vue Component for List

  • 1.0.3-alpha.0
  • alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
9
Weekly downloads
 
Created
Source

CdrList

For the most up-to-date information, see REI Cedar documentation.

Properties

nametypedefault
Tagstring'ul'
Sets valid HTML element tag for lists. Possible values: { ‘ul’‘ol’ }
nametypedefault
modifierstringN/A
Modifies the style variant for this component. Possible values: { ‘ordered’‘unordered’‘compact’

Slots

name
default
Sets the innerHTML for cdr-list. This includes text and html markup

Installation

Resources are available within the CdrList package:

  • Component: @rei/cdr-list
  • Component styles: cdr-list.css

To incorporate the required assets for a component, use the following steps:

1. Install using NPM

Install the CdrList package using npm in your terminal:

Terminal

npm i -s @rei/cdr-list

2. Import dependencies

main.js

// import your required css.
import "@rei/cdr-list/dist/cdr-list.css";

3. Add component to a template

local.vue

<template>
  <cdr-list>
    <li> item one </li>
    <li> item two </li>
  </cdr-list>
</template>

<script>
import { CdrList } from "@rei/cdr-list";
export default {
  components: {
    CdrList
  }
};
</script>

Usage

Visual style and semantic meaning are managed independently by providing:

  • Element to the tag prop
  • Style to the modifier prop

By default the CdrList component renders as an unordered and undecorated "bare" list. To use an ordered list pass <ol> to the tag property.

<cdr-list tag="ol">
  <li> item one </li>
  <li> item two </li>
</cdr-list>

The CdrList component has decoupled the semantic tags <ul> and <ol> from visual presentation. It is possible to render a semantic ordered list <ol> as a visually non styled or bulleted list using the cdr-list modifiers. With this decoupling, individual list items can contain a variety of HTML elements, including paragraphs, headings, form elements, and other (nested) lists. Ensure that content is structured and follows design guidelines.

Tag variants

Following are different types of lists:

  • Unordered lists:
    • Used when the order of the items is not relevant
    • Consists of one <ul> element and multiple list item <li> elements
  • Ordered lists:
    • Used for sequential information
    • Consists of one <ol> element and multiple list item <li> elements
  • Nested lists:
    • Every cdr-list can be nested into another list
    • Assistive technology can easily inform users about the number of steps
<cdr-list>
   <li> Unordered list item text
     <cdr-list tag="ol">
       <li>Ordered list item text</li>
     </cdr-list>
   </li>
 </cdr-list>
  • Bare or unstyled lists:
    • Can contain a variety of HTML elements, including paragraphs, headings, form elements, and other (nested) lists

Modifier options

Note that the tag itself does not determine display, a modifier must be added for list styles. Add one of the following variants to the modifier attribute of the cdr-list tag to change the visual presentation:

NameDescriptionExample
unorderedThe unordered modifier adds a bullet decorator to child list items and a ‘en-dash’ decorator to grandchild list items. This variant can be used on both <ul> or <ol> list types.<cdr-list modifier="unordered" >
orderedThe ordered modifier adds a numeric decorator to child list items and a ‘en-dash’ decorator to grandchild list items. This variant can be used on both <ul> or <ol> list types.<cdr-list tag="ol" modifier="ordered" >
compactThe compact modifier reduces the vertical space between list items for non-inline list variants. For inline variants the compact modifier reduces the horizontal space between list items.<cdr-list modifier="compact">
inlineThe inline modifier is intended for bare or unordered list variants. In ether case this can be combined with compact to adjust the spacing of inline list variants.<cdr-list modifier=" inline">

FAQs

Package last updated on 26 Mar 2019

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