14.7.4 • Published 2 days ago

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

Weekly downloads
463
License
ISC
Repository
github
Last release
2 days 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.4

2 days ago

14.7.3

8 days ago

14.7.2

23 days ago

14.7.1

1 month ago

14.7.0

1 month ago

14.6.5

1 month ago

14.6.3

2 months ago

14.6.4

2 months ago

14.6.2

2 months ago

14.6.0

2 months ago

14.6.1

2 months ago

14.5.2

3 months ago

14.5.0

3 months ago

14.5.1

3 months ago

14.4.2

3 months ago

14.4.1

4 months ago

14.4.0

4 months ago

14.3.1

4 months ago

14.3.0

4 months ago

14.2.0

5 months ago

12.0.0-beta.2

11 months ago

12.0.0-beta.3

11 months ago

12.0.0-beta.1

11 months ago

14.1.0

6 months ago

14.1.1

6 months ago

14.1.2

6 months ago

12.0.0

10 months ago

12.0.1

10 months ago

12.0.2

9 months ago

11.2.0

11 months ago

12.0.1-beta.1

11 months ago

14.0.0

9 months ago

14.0.1

8 months ago

13.0.0

9 months ago

14.0.2

8 months ago

13.0.1

9 months ago

14.0.3

8 months ago

14.0.4

7 months ago

11.1.1

12 months ago

11.1.2

11 months ago

11.1.0

12 months ago

10.5.0

1 year ago

10.4.0

1 year ago

11.0.0

1 year ago

10.3.0

1 year ago

10.0.0

1 year ago

10.1.0

1 year ago

10.2.0

1 year ago

10.1.1

1 year ago

10.1.2

1 year ago

8.2.3

1 year ago

8.2.2

2 years ago

8.2.5

1 year ago

8.2.4

1 year ago

8.2.1

2 years ago

8.2.0

2 years ago

8.1.1

2 years ago

8.1.0

2 years ago

8.0.5

2 years ago

8.0.4

2 years ago

8.0.6

2 years ago

8.0.3

2 years ago

8.0.2

2 years ago

6.8.2-beta.1

2 years ago

8.0.1

2 years ago

8.0.0

2 years ago

8.0.1-beta.1

2 years ago

6.8.1

2 years ago

7.0.0

2 years ago

6.4.1

2 years ago

6.6.0

2 years ago

6.8.0

2 years ago

6.7.1

2 years ago

0.0.12

2 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago