react-icons/fa APIs
- FaTwitter
- FaGithub
- FaInstagram
- FaLinkedin
- FaTimes
- FaPlus
- FaFacebookF
- FaSearch
- FaYoutube
- FaFacebook
- FaTrash
- FaHeart
- FaLinkedinIn
- FaBars
- FaEnvelope
- FaStar
- FaPlay
- FaHome
- FaEdit
- FaSun
- FaMoon
- FaUser
- FaGithubAlt
- FaFacebookSquare
- FaArrowRight
- FaCheck
- FaTwitterSquare
- FaAngleRight
- FaInfoCircle
- FaMapMarkerAlt
- FaArrowLeft
- FaPen
- FaTrashAlt
- FaShoppingCart
- FaGithubSquare
- FaCheckCircle
- FaDownload
- FaCaretDown
- FaChevronRight
- FaCog
- FaCode
- FaDev
- FaDribbble
- FaLocationArrow
- FaExternalLinkAlt
- FaAngleDown
- FaArrowUp
- FaSignOutAlt
- FaTags
- FaQuoteLeft
- FaPause
- FaChevronLeft
- FaChevronDown
- FaReact
- FaFolderOpen
- FaCircle
- FaAngleLeft
- FaCompass
- FaAlignRight
- FaMinus
- FaBoxOpen
- FaLink
- FaUsers
- FaGoogle
- FaTwitch
- FaRss
- FaSpotify
- FaCrown
- FaLock
- FaCopyright
- FaRegTrashAlt
- FaUserAlt
- FaRegStar
- FaPhone
- FaMapMarkedAlt
- FaRegCircle
- FaVolumeUp
- FaDiscord
- FaUserCircle
- FaList
- FaStackOverflow
- FaFreeCodeCamp
- FaMicrophone
- FaRedo
- FaClipboard
- FaChevronUp
- FaLongArrowAltRight
- FaAngleDoubleRight
- FaKey
- FaCubes
- FaBan
- FaMediumM
- FaPinterest
- FaVideo
- FaDribbbleSquare
- FaComment
- FaBellSlash
- FaRegBuilding
- FaSlack
- FaItunesNote
- FaBox
- FaWonSign
- FaAirbnb
- FaDoorOpen
- FaGlobe
- FaBath
- FaParking
- FaWhatsapp
- FaUserInjured
- FaRegPlusSquare
- FaPlayCircle
- FaPauseCircle
- FaVolumeMute
- FaSpinner
- FaRegLightbulb
- FaCcVisa
- FaCcMastercard
- FaCcPaypal
- FaCcAmazonPay
- FaRegHeart
- FaCartArrowDown
- FaCartPlus
- FaPinterestSquare
- FaPaypal
- FaAmazon
- FaShopify
- FaApple
- FaTruck
- FaUndoAlt
- FaRocketchat
- FaWallet
- FaPinterestP
- FaGooglePlay
- FaCaretUp
- FaFilter
- FaCalendarAlt
- FaCodeBranch
- FaExclamationCircle
- FaEye
- FaOsi
- FaRegEdit
- FaMicrophoneAlt
- FaMicrophoneAltSlash
- FaCogs
- FaEllipsisH
- FaEquals
- FaQrcode
- FaAddressBook
- FaServer
- FaFolder
- FaLongArrowAltLeft
- FaSkype
- FaHandHoldingHeart
- FaRegPaperPlane
- FaRegBookmark
- FaInbox
- FaHamburger
- FaSearchLocation
- FaBirthdayCake
- FaUserGraduate
- FaGoogleDrive
- FaPaperPlane
- FaLockOpen
- FaUserFriends
- FaExchangeAlt
- FaEllipsisV
- FaSortAmountDown
- FaSortAmountUp
- FaCaretSquareRight
- FaCaretSquareLeft
- FaColumns
- FaUndo
- FaQuestionCircle
- FaBloggerB
- FaRedditAlien
- FaCodepen
- FaGitlab
- FaBlogger
- FaCameraRetro
- FaTabletAlt
- FaRegNewspaper
- FaRegCalendarAlt
- FaForward
- FaQuoteRight
- FaVoteYea
- FaShareSquare
- FaBehanceSquare
- FaSignInAlt
- FaSkull
- FaReddit
- FaRegSmileBeam
- FaWindowClose
- FaWindowMinimize
- FaWindowMaximize
- FaPaste
- FaStopwatch
- FaStop
- FaSave
- FaFileExport
- FaHandPointer
- FaFile
- FaMapSigns
- FaClipboardCheck
- FaClock
- FaThList
- FaDumbbell
- FaGuitar
- FaNetworkWired
- FaPuzzlePiece
- FaUserEdit
- FaEyeSlash
- FaPhoneAlt
- FaStickyNote
- FaThumbsUp
- FaThumbsDown
- FaArrowCircleUp
- FaLightbulb
- FaBookOpen
- FaRegSquare
- FaItalic
- FaBold
- FaPencilAlt
- FaSlash
- FaShapes
- FaShip
- FaTree
- FaFilePdf
- FaRegArrowAltCircleRight
- FaFileUpload
- FaKeyboard
- FaBehance
- FaGoodreadsG
- FaProductHunt
- FaXing
- FaBolt
OtherRelated APIs
react-icons/fa#FaPaperPlane JavaScript Examples
The following examples show how to use
react-icons/fa#FaPaperPlane.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js From hackchat-client with Do What The F*ck You Want To Public License | 4 votes |
export function ChatInput({ channel, onSendChat }) {
const [chatInputField, setChatInput] = useStateIfMounted();
const [msgHistory, updateMsgHistory] = useStateIfMounted([]);
const [searchIndex, setSearchIndex] = useStateIfMounted(0);
useEffect(() => {
const listener = (evt) => {
if (evt.code === 'Enter' || evt.code === 'NumpadEnter') {
if (!evt.shiftKey) {
submitInput(evt);
chatInputField.style.height = 'auto';
} else {
chatInputField.style.height = 'inherit';
chatInputField.style.height = `${chatInputField.scrollHeight}px`;
}
} else if (evt.code === 'ArrowUp' && chatInputField) {
if (chatInputField.selectionStart !== 0) return;
if (searchIndex === 0 && chatInputField.value) {
updateMsgHistory(
[chatInputField.value].concat(msgHistory.slice(0, MaxMsgHistory)),
);
}
setSearchIndex(incSearchIndex(searchIndex, msgHistory.length));
chatInputField.value = msgHistory[searchIndex] || '';
} else if (evt.code === 'ArrowDown' && chatInputField) {
if (chatInputField.selectionStart !== chatInputField.value.length)
return;
setSearchIndex(decSearchIndex(searchIndex));
chatInputField.value = msgHistory[searchIndex] || '';
}
};
document.addEventListener('keydown', listener);
return () => {
document.removeEventListener('keydown', listener);
};
}, [chatInputField, searchIndex, msgHistory]);
const submitInput = (evt) => {
if (evt) {
if (evt.preventDefault) evt.preventDefault();
if (evt.stopPropagation) evt.stopPropagation();
if (evt.nativeEvent && evt.nativeEvent.stopImmediatePropagation)
evt.nativeEvent.stopImmediatePropagation();
}
const chatText = chatInputField.value;
if (chatText) {
onSendChat(channel, chatText);
chatInputField.value = '';
if (searchIndex !== 0) {
setSearchIndex(0);
}
updateMsgHistory([chatText].concat(msgHistory.slice(0, MaxMsgHistory)));
}
};
const onUserInput = (evt) => {
const { target } = evt;
setChatInput(target);
if (target.value) {
target.style.height = 'inherit';
target.style.height = `${target.scrollHeight + 2}px`;
} else {
target.style.height = 'auto';
}
};
const inputDom = (
<Form onSubmit={submitInput}>
<InputGroup size="sm">
<FormattedMessage
id={messages.MainInput.id}
defaultMessage={messages.MainInput.defaultMessage}
>
{(placeholder) => (
<UserInput
autoFocus
rows="1"
onChange={onUserInput}
type="textarea"
placeholder={placeholder}
/>
)}
</FormattedMessage>
<InputGroupAddon className="d-flex" addonType="append">
<SendButton type="submit">
<FaPaperPlane />
</SendButton>
</InputGroupAddon>
</InputGroup>
</Form>
);
return inputDom;
}