@springernature/nature-sort-by

5.0.0 • Public • Published

Nature Sort By

NPM version

The Nature Sort by component lets users change the order of a list of content items. For example, to sort search results by date or relevance.

Installation

To use the Sort By component, enter the following command in your Terminal:

npm install @springernature/nature-sort-by

Usage

Import the js and scss as follows:

import {sortBy} from '@springernature/nature-sort-by/js/sort-by';

sortBy();
@import '@springernature/nature-sort-by/scss/10-settings/sort-by';
@import '@springernature/nature-sort-by/scss/50-components/sort-by';

Insert the component's HTML inside an HTML form in your application. See an example template below.

Template

Find a configurable template in the Sort by's view folder.

See an example usage in the Sort by's demo folder.

Configuration

The Sort By component passes data to a backend to tell it how a list of content should be sorted. This is done using a standard form submission and requires you to have a backend to receive and that process the form data. Edit the values of the name and value html attributes on the radio inputs to define data appropriate for your backend logic.

Readme

Keywords

none

Package Sidebar

Install

npm i @springernature/nature-sort-by

Weekly Downloads

4

Version

5.0.0

License

MIT

Unpacked Size

40.9 kB

Total Files

13

Last publish

Collaborators

  • ndv3997
  • sndigital
  • rseidelsohn
  • testingsabrina
  • roshandeorukhkar-sn
  • benjclark
  • sonniesedge
  • rlau
  • dotcode
  • joseluisbolos
  • hollsk
  • moddular
  • jpw
  • nickcall
  • howlingmad
  • davidpauljunior
  • morgaan