14.7.7 • Published 11 months ago

@financial-times/x-topic-search v14.7.7

Weekly downloads
463
License
ISC
Repository
github
Last release
11 months ago

x-topic-search

This module allows a user to search for topics by name, and follow them. If an already-followed topic is returned in the search results, then those topics are indicated as such.

The search results are fetched from the api whose url is passed as a property. next-myft-page uses next-tag-facets-api.

Installation

This module is compatible with Node 6+ and is distributed on npm.

npm install --save @financial-times/x-topic-search

The x-engine module is used to inject your chosen runtime into the component. Please read the x-engine documentation first if you are consuming x- components for the first time in your application.

Usage

The components provided by this module are all functions that expect a map of properties. They can be used with vanilla JavaScript or JSX (If you are not familiar check out WTF is JSX first). For example if you were writing your application using React you could use the component like this:

import React from 'react';
import { TopicSearch } from '@financial-times/x-topic-search';

// A == B == C
const a = TopicSearch(props);
const b = <TopicSearch {...props} />;
const c = React.createElement(TopicSearch, props);

All x- components are designed to be compatible with a variety of runtimes, not just React. Check out the x-engine documentation for a list of recommended libraries and frameworks.

The consumer of this component needs to update followedTopicIds every time when users follow or unfollow topics.

Properties

PropertyTypeRequiredNote
minSearchLengthNumberNoMinimum chars to start search. Default is 2
maxSuggestionsNumberNoMaximum number to display suggestions. Default is 5
apiUrlStringYesThe url to use when making requests to get topics
followedTopicIdsArrayYesArray of followed topic ids.
csrfTokenStringYesValue included in a hidden form field for x-follow-button
renderFollowButtonFunctionNoOptional render prop for the follow button
14.7.7

11 months ago

14.7.6

11 months ago

14.7.5

1 year ago

14.7.4

1 year ago

14.7.3

1 year ago

14.7.2

1 year ago

14.7.1

1 year ago

14.7.0

1 year ago

14.6.5

1 year ago

14.6.3

1 year ago

14.6.4

1 year ago

14.6.2

1 year ago

14.6.0

1 year ago

14.6.1

1 year ago

14.5.2

1 year ago

14.5.0

1 year ago

14.5.1

1 year ago

14.4.2

1 year ago

14.4.1

1 year ago

14.4.0

1 year ago

14.3.1

1 year ago

14.3.0

2 years ago

14.2.0

2 years ago

12.0.0-beta.2

2 years ago

12.0.0-beta.3

2 years ago

12.0.0-beta.1

2 years ago

14.1.0

2 years ago

14.1.1

2 years ago

14.1.2

2 years ago

12.0.0

2 years ago

12.0.1

2 years ago

12.0.2

2 years ago

11.2.0

2 years ago

12.0.1-beta.1

2 years ago

14.0.0

2 years ago

14.0.1

2 years ago

13.0.0

2 years ago

14.0.2

2 years ago

13.0.1

2 years ago

14.0.3

2 years ago

14.0.4

2 years ago

11.1.1

2 years ago

11.1.2

2 years ago

11.1.0

2 years ago

10.5.0

2 years ago

10.4.0

2 years ago

11.0.0

2 years ago

10.3.0

2 years ago

10.0.0

2 years ago

10.1.0

2 years ago

10.2.0

2 years ago

10.1.1

2 years ago

10.1.2

2 years ago

8.2.3

3 years ago

8.2.2

3 years ago

8.2.5

3 years ago

8.2.4

3 years ago

8.2.1

3 years ago

8.2.0

3 years ago

8.1.1

3 years ago

8.1.0

3 years ago

8.0.5

3 years ago

8.0.4

3 years ago

8.0.6

3 years ago

8.0.3

3 years ago

8.0.2

3 years ago

6.8.2-beta.1

3 years ago

8.0.1

3 years ago

8.0.0

3 years ago

8.0.1-beta.1

3 years ago

6.8.1

3 years ago

7.0.0

3 years ago

6.4.1

3 years ago

6.6.0

3 years ago

6.8.0

3 years ago

6.7.1

3 years ago

0.0.12

4 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago